/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('pairecservice', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model TrafficControlTaskTrafficInfoTargetTrafficsDataValue = {
  traffic?: double(name='Traffic'),
  recordTime?: long(name='RecordTime'),
}

model TrafficControlTaskTrafficInfoTaskTrafficsValue = {
  traffic?: double(name='Traffic'),
}

model ExperimentReportValue = {
  baseline?: boolean(name='Baseline', example='true'),
  metricResults?: map[string]object(name='MetricResults'),
}

model ApplyEngineConfigRequest {
  instanceId?: string(name='InstanceId', example='pairec-cn-***test'),
}

model ApplyEngineConfigResponseBody = {
  requestId?: string(name='RequestId', example='F8F613A9-DF1C-551A-88E1-397A3981A785'),
}

model ApplyEngineConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ApplyEngineConfigResponseBody(name='body'),
}

/**
 * @summary 应用/发布指定的推荐引擎配置
 *
 * @param request ApplyEngineConfigRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ApplyEngineConfigResponse
 */
async function applyEngineConfigWithOptions(EngineConfigId: string, request: ApplyEngineConfigRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ApplyEngineConfigResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ApplyEngineConfig',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/engineconfigs/${OpenApiUtil.getEncodeParam(EngineConfigId)}/action/apply`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 应用/发布指定的推荐引擎配置
 *
 * @param request ApplyEngineConfigRequest
 * @return ApplyEngineConfigResponse
 */
async function applyEngineConfig(EngineConfigId: string, request: ApplyEngineConfigRequest): ApplyEngineConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return applyEngineConfigWithOptions(EngineConfigId, request, headers, runtime);
}

model BackflowFeatureConsistencyCheckJobDataRequest {
  featureConsistencyCheckJobConfigId?: string(name='FeatureConsistencyCheckJobConfigId', description='This parameter is required.', example='4'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-********'),
  itemFeatures?: string(name='ItemFeatures', description='This parameter is required.', example='[\\\\"{\\\\\\\\\\\\"itemid\\\\\\\\\\\\":{\\\\\\\\\\\\"value\\\\\\\\\\\\":1010,\\\\\\\\\\\\"type\\\\\\\\\\\\":\\\\\\\\\\\\"string\\\\\\\\\\\\"}}\\\\"]'),
  logItemId?: string(name='LogItemId', description='This parameter is required.', example='9010'),
  logRequestId?: string(name='LogRequestId', description='This parameter is required.', example='728C5E01-ABF6-5AA8-B9FC-B3BA05DECC77'),
  logRequestTime?: long(name='LogRequestTime', description='This parameter is required.', example='1693900981465'),
  logUserId?: string(name='LogUserId', description='This parameter is required.', example='1010'),
  sceneName?: string(name='SceneName', description='This parameter is required.', example='video-feed'),
  scores?: string(name='Scores', description='This parameter is required.', example='[\\\\"{\\\\\\\\\\\\"dbmtl_probs_is_valid_play\\\\\\\\\\\\":0.00032182207107543945,\\\\\\\\\\\\"dbmtl_y_play_time\\\\\\\\\\\\":0.0043269748210906982}\\\\"]'),
  serviceName?: string(name='ServiceName'),
  userFeatures?: string(name='UserFeatures', description='This parameter is required.', example='{\\\\"userid\\\\":{\\\\"value\\\\":1010,\\\\"type\\\\":\\\\"string\\\\"},\\\\"click_5_seq\\\\":{\\\\"value\\\\":\\\\"9001;9002;9003;9004;9005\\\\",\\\\"type\\\\":\\\\"string\\\\"}}'),
}

model BackflowFeatureConsistencyCheckJobDataResponseBody = {
  requestId?: string(name='RequestId', example='BDB621CB-A81E-5D39-8793-39A365CBCC74'),
}

model BackflowFeatureConsistencyCheckJobDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BackflowFeatureConsistencyCheckJobDataResponseBody(name='body'),
}

/**
 * @summary 特征一致性检查数据回流。
 *
 * @param request BackflowFeatureConsistencyCheckJobDataRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return BackflowFeatureConsistencyCheckJobDataResponse
 */
async function backflowFeatureConsistencyCheckJobDataWithOptions(request: BackflowFeatureConsistencyCheckJobDataRequest, headers: map[string]string, runtime: Util.RuntimeOptions): BackflowFeatureConsistencyCheckJobDataResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.featureConsistencyCheckJobConfigId)) {
    body['FeatureConsistencyCheckJobConfigId'] = request.featureConsistencyCheckJobConfigId;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.itemFeatures)) {
    body['ItemFeatures'] = request.itemFeatures;
  }
  if (!Util.isUnset(request.logItemId)) {
    body['LogItemId'] = request.logItemId;
  }
  if (!Util.isUnset(request.logRequestId)) {
    body['LogRequestId'] = request.logRequestId;
  }
  if (!Util.isUnset(request.logRequestTime)) {
    body['LogRequestTime'] = request.logRequestTime;
  }
  if (!Util.isUnset(request.logUserId)) {
    body['LogUserId'] = request.logUserId;
  }
  if (!Util.isUnset(request.sceneName)) {
    body['SceneName'] = request.sceneName;
  }
  if (!Util.isUnset(request.scores)) {
    body['Scores'] = request.scores;
  }
  if (!Util.isUnset(request.serviceName)) {
    body['ServiceName'] = request.serviceName;
  }
  if (!Util.isUnset(request.userFeatures)) {
    body['UserFeatures'] = request.userFeatures;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'BackflowFeatureConsistencyCheckJobData',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/featureconsistencycheck/jobs/action/backflowdata`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 特征一致性检查数据回流。
 *
 * @param request BackflowFeatureConsistencyCheckJobDataRequest
 * @return BackflowFeatureConsistencyCheckJobDataResponse
 */
async function backflowFeatureConsistencyCheckJobData(request: BackflowFeatureConsistencyCheckJobDataRequest): BackflowFeatureConsistencyCheckJobDataResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return backflowFeatureConsistencyCheckJobDataWithOptions(request, headers, runtime);
}

model CheckInstanceResourcesRequest {
  type?: string(name='Type', description='This parameter is required.', example='OSS'),
  uri?: string(name='Uri', example='bucket-test-123'),
}

model CheckInstanceResourcesResponseBody = {
  requestId?: string(name='RequestId', example='9763624B-5FBB-5E3A-9193-B1ADB554CEAE'),
  resources?: [ 
    {
      status?: string(name='Status', example='Success'),
      type?: string(name='Type', example='OSS'),
      uri?: string(name='Uri', example='bucket-test-123'),
    }
  ](name='Resources'),
}

model CheckInstanceResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckInstanceResourcesResponseBody(name='body'),
}

/**
 * @summary 检测实例下配置的资源的连接状态。
 *
 * @param request CheckInstanceResourcesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CheckInstanceResourcesResponse
 */
async function checkInstanceResourcesWithOptions(InstanceId: string, request: CheckInstanceResourcesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CheckInstanceResourcesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }
  if (!Util.isUnset(request.uri)) {
    body['Uri'] = request.uri;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CheckInstanceResources',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/action/checkresources`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 检测实例下配置的资源的连接状态。
 *
 * @param request CheckInstanceResourcesRequest
 * @return CheckInstanceResourcesResponse
 */
async function checkInstanceResources(InstanceId: string, request: CheckInstanceResourcesRequest): CheckInstanceResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return checkInstanceResourcesWithOptions(InstanceId, request, headers, runtime);
}

model CheckTrafficControlTaskExpressionRequest {
  expression?: string(name='Expression', description='This parameter is required.'),
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
  tableMetaId?: string(name='TableMetaId', description='This parameter is required.'),
}

model CheckTrafficControlTaskExpressionResponseBody = {
  isValie?: boolean(name='IsValie'),
  reason?: string(name='Reason'),
  requestId?: string(name='RequestId'),
}

model CheckTrafficControlTaskExpressionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckTrafficControlTaskExpressionResponseBody(name='body'),
}

/**
 * @summary 校验流量调控任务中的表达式
 *
 * @param request CheckTrafficControlTaskExpressionRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CheckTrafficControlTaskExpressionResponse
 */
async function checkTrafficControlTaskExpressionWithOptions(request: CheckTrafficControlTaskExpressionRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CheckTrafficControlTaskExpressionResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.expression)) {
    query['Expression'] = request.expression;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.tableMetaId)) {
    query['TableMetaId'] = request.tableMetaId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckTrafficControlTaskExpression',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/trafficcontroltasks/action/checkexpression`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 校验流量调控任务中的表达式
 *
 * @param request CheckTrafficControlTaskExpressionRequest
 * @return CheckTrafficControlTaskExpressionResponse
 */
async function checkTrafficControlTaskExpression(request: CheckTrafficControlTaskExpressionRequest): CheckTrafficControlTaskExpressionResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return checkTrafficControlTaskExpressionWithOptions(request, headers, runtime);
}

model CloneEngineConfigRequest {
  configValue?: string(name='ConfigValue', example='{}'),
  description?: string(name='Description'),
  environment?: string(name='Environment', example='Pre'),
  instanceId?: string(name='InstanceId', example='pairec-cn-********'),
}

model CloneEngineConfigResponseBody = {
  engineConfigId?: string(name='EngineConfigId', example='2'),
  requestId?: string(name='RequestId', example='A04CB8C0-E74A-5E83-BC61-64D153574EC7'),
}

model CloneEngineConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CloneEngineConfigResponseBody(name='body'),
}

/**
 * @summary 克隆指定的推荐引擎配置
 *
 * @param request CloneEngineConfigRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CloneEngineConfigResponse
 */
async function cloneEngineConfigWithOptions(EngineConfigId: string, request: CloneEngineConfigRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CloneEngineConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.configValue)) {
    body['ConfigValue'] = request.configValue;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.environment)) {
    body['Environment'] = request.environment;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CloneEngineConfig',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/engineconfigs/${OpenApiUtil.getEncodeParam(EngineConfigId)}/action/clone`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 克隆指定的推荐引擎配置
 *
 * @param request CloneEngineConfigRequest
 * @return CloneEngineConfigResponse
 */
async function cloneEngineConfig(EngineConfigId: string, request: CloneEngineConfigRequest): CloneEngineConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return cloneEngineConfigWithOptions(EngineConfigId, request, headers, runtime);
}

model CloneExperimentRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-abcdefg1234'),
}

model CloneExperimentResponseBody = {
  experimentId?: string(name='ExperimentId', example='3'),
  requestId?: string(name='RequestId', description='Id of the request', example='F8F613A9-DF1C-551A-88E1-397A3981A785'),
}

model CloneExperimentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CloneExperimentResponseBody(name='body'),
}

/**
 * @summary 克隆实验。
 *
 * @param request CloneExperimentRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CloneExperimentResponse
 */
async function cloneExperimentWithOptions(ExperimentId: string, request: CloneExperimentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CloneExperimentResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CloneExperiment',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/experiments/${OpenApiUtil.getEncodeParam(ExperimentId)}/action/clone`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 克隆实验。
 *
 * @param request CloneExperimentRequest
 * @return CloneExperimentResponse
 */
async function cloneExperiment(ExperimentId: string, request: CloneExperimentRequest): CloneExperimentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return cloneExperimentWithOptions(ExperimentId, request, headers, runtime);
}

model CloneExperimentGroupRequest {
  environment?: string(name='Environment', description='This parameter is required.', example='Daily'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-abcdefg1234'),
  layerId?: string(name='LayerId', description='This parameter is required.', example='3'),
}

model CloneExperimentGroupResponseBody = {
  experimentGroupId?: string(name='ExperimentGroupId', example='3'),
  requestId?: string(name='RequestId', description='Id of the request', example='12A65C6C-AFA1-59B2-9A66-A9E0BB73F0E5'),
}

model CloneExperimentGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CloneExperimentGroupResponseBody(name='body'),
}

/**
 * @summary 克隆实验组，并克隆实验组下的所有实验至新的实验组中。
 *
 * @param request CloneExperimentGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CloneExperimentGroupResponse
 */
async function cloneExperimentGroupWithOptions(ExperimentGroupId: string, request: CloneExperimentGroupRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CloneExperimentGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.environment)) {
    body['Environment'] = request.environment;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.layerId)) {
    body['LayerId'] = request.layerId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CloneExperimentGroup',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/experimentgroups/${OpenApiUtil.getEncodeParam(ExperimentGroupId)}/action/clone`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 克隆实验组，并克隆实验组下的所有实验至新的实验组中。
 *
 * @param request CloneExperimentGroupRequest
 * @return CloneExperimentGroupResponse
 */
async function cloneExperimentGroup(ExperimentGroupId: string, request: CloneExperimentGroupRequest): CloneExperimentGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return cloneExperimentGroupWithOptions(ExperimentGroupId, request, headers, runtime);
}

model CloneFeatureConsistencyCheckJobConfigRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-********'),
}

model CloneFeatureConsistencyCheckJobConfigResponseBody = {
  featureConsistencyCheckId?: string(name='FeatureConsistencyCheckId', example='4'),
  requestId?: string(name='RequestId', example='74D958EF-3598-56FA-8296-FF1575CE43DF'),
}

model CloneFeatureConsistencyCheckJobConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CloneFeatureConsistencyCheckJobConfigResponseBody(name='body'),
}

/**
 * @summary 克隆特征一致性检查配置。
 *
 * @param request CloneFeatureConsistencyCheckJobConfigRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CloneFeatureConsistencyCheckJobConfigResponse
 */
async function cloneFeatureConsistencyCheckJobConfigWithOptions(SourceFeatureConsistencyCheckJobConfigId: string, request: CloneFeatureConsistencyCheckJobConfigRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CloneFeatureConsistencyCheckJobConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CloneFeatureConsistencyCheckJobConfig',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/featureconsistencycheck/jobconfigs/${OpenApiUtil.getEncodeParam(SourceFeatureConsistencyCheckJobConfigId)}/action/clone`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 克隆特征一致性检查配置。
 *
 * @param request CloneFeatureConsistencyCheckJobConfigRequest
 * @return CloneFeatureConsistencyCheckJobConfigResponse
 */
async function cloneFeatureConsistencyCheckJobConfig(SourceFeatureConsistencyCheckJobConfigId: string, request: CloneFeatureConsistencyCheckJobConfigRequest): CloneFeatureConsistencyCheckJobConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return cloneFeatureConsistencyCheckJobConfigWithOptions(SourceFeatureConsistencyCheckJobConfigId, request, headers, runtime);
}

model CloneLaboratoryRequest {
  cloneExperimentGroup?: boolean(name='CloneExperimentGroup', description='This parameter is required.', example='true'),
  environment?: string(name='Environment', description='This parameter is required.', example='Daily'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-abcdefg1234'),
}

model CloneLaboratoryResponseBody = {
  laboratoryId?: string(name='LaboratoryId', example='3'),
  requestId?: string(name='RequestId', description='Id of the request', example='01D22D08-BA20-5F35-8302-99115F288220'),
}

model CloneLaboratoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CloneLaboratoryResponseBody(name='body'),
}

/**
 * @summary 克隆实验室。
 *
 * @param request CloneLaboratoryRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CloneLaboratoryResponse
 */
async function cloneLaboratoryWithOptions(LaboratoryId: string, request: CloneLaboratoryRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CloneLaboratoryResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.cloneExperimentGroup)) {
    body['CloneExperimentGroup'] = request.cloneExperimentGroup;
  }
  if (!Util.isUnset(request.environment)) {
    body['Environment'] = request.environment;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CloneLaboratory',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/laboratories/${OpenApiUtil.getEncodeParam(LaboratoryId)}/action/clone`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 克隆实验室。
 *
 * @param request CloneLaboratoryRequest
 * @return CloneLaboratoryResponse
 */
async function cloneLaboratory(LaboratoryId: string, request: CloneLaboratoryRequest): CloneLaboratoryResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return cloneLaboratoryWithOptions(LaboratoryId, request, headers, runtime);
}

model CloneTrafficControlTaskRequest {
  instanceId?: string(name='InstanceId'),
}

model CloneTrafficControlTaskResponseBody = {
  requestId?: string(name='RequestId'),
  trafficControlTaskId?: string(name='TrafficControlTaskId'),
}

model CloneTrafficControlTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CloneTrafficControlTaskResponseBody(name='body'),
}

/**
 * @summary 克隆流量调控任务
 *
 * @param request CloneTrafficControlTaskRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CloneTrafficControlTaskResponse
 */
async function cloneTrafficControlTaskWithOptions(TrafficControlTaskId: string, request: CloneTrafficControlTaskRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CloneTrafficControlTaskResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CloneTrafficControlTask',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/trafficcontroltasks/${OpenApiUtil.getEncodeParam(TrafficControlTaskId)}/action/clone`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 克隆流量调控任务
 *
 * @param request CloneTrafficControlTaskRequest
 * @return CloneTrafficControlTaskResponse
 */
async function cloneTrafficControlTask(TrafficControlTaskId: string, request: CloneTrafficControlTaskRequest): CloneTrafficControlTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return cloneTrafficControlTaskWithOptions(TrafficControlTaskId, request, headers, runtime);
}

model CreateABMetricRequest {
  definition?: string(name='Definition', description='This parameter is required.', example='sum(click_cnt)'),
  description?: string(name='Description', description='This parameter is required.'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-test1'),
  leftMetricId?: string(name='LeftMetricId', example='2'),
  name?: string(name='Name', description='This parameter is required.', example='pv'),
  operator?: string(name='Operator', example='Division'),
  realtime?: boolean(name='Realtime', description='This parameter is required.', example='false'),
  resultResourceId?: string(name='ResultResourceId', example='3'),
  rightMetricId?: string(name='RightMetricId', example='3'),
  sceneId?: string(name='SceneId', description='This parameter is required.', example='1'),
  statisticsCycle?: int32(name='StatisticsCycle', example='1'),
  tableMetaId?: string(name='TableMetaId', description='This parameter is required.', example='2'),
  type?: string(name='Type', description='This parameter is required.', example='Single'),
}

model CreateABMetricResponseBody = {
  ABMetricId?: string(name='ABMetricId', example='1'),
  requestId?: string(name='RequestId', example='F7AC05FF-EDE7-5C2B-B9AE-33D6DF4178BA'),
}

model CreateABMetricResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateABMetricResponseBody(name='body'),
}

/**
 * @summary 创建AB test实验指标
 *
 * @param request CreateABMetricRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateABMetricResponse
 */
async function createABMetricWithOptions(request: CreateABMetricRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateABMetricResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.definition)) {
    body['Definition'] = request.definition;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.leftMetricId)) {
    body['LeftMetricId'] = request.leftMetricId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.operator)) {
    body['Operator'] = request.operator;
  }
  if (!Util.isUnset(request.realtime)) {
    body['Realtime'] = request.realtime;
  }
  if (!Util.isUnset(request.resultResourceId)) {
    body['ResultResourceId'] = request.resultResourceId;
  }
  if (!Util.isUnset(request.rightMetricId)) {
    body['RightMetricId'] = request.rightMetricId;
  }
  if (!Util.isUnset(request.sceneId)) {
    body['SceneId'] = request.sceneId;
  }
  if (!Util.isUnset(request.statisticsCycle)) {
    body['StatisticsCycle'] = request.statisticsCycle;
  }
  if (!Util.isUnset(request.tableMetaId)) {
    body['TableMetaId'] = request.tableMetaId;
  }
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateABMetric',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/abmetrics`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建AB test实验指标
 *
 * @param request CreateABMetricRequest
 * @return CreateABMetricResponse
 */
async function createABMetric(request: CreateABMetricRequest): CreateABMetricResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createABMetricWithOptions(request, headers, runtime);
}

model CreateABMetricGroupRequest {
  ABMetricIds?: string(name='ABMetricIds', description='This parameter is required.', example='1,2'),
  description?: string(name='Description', description='This parameter is required.'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-test1'),
  name?: string(name='Name', description='This parameter is required.', example='visits'),
  realtime?: boolean(name='Realtime', description='This parameter is required.', example='false'),
  sceneId?: string(name='SceneId', description='This parameter is required.', example='1'),
}

model CreateABMetricGroupResponseBody = {
  ABMetricGroupId?: string(name='ABMetricGroupId', example='1'),
  requestId?: string(name='RequestId', example='E15A1443-7917-5BE0-AE70-25538ECF398D'),
}

model CreateABMetricGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateABMetricGroupResponseBody(name='body'),
}

/**
 * @summary 创建指标组
 *
 * @param request CreateABMetricGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateABMetricGroupResponse
 */
async function createABMetricGroupWithOptions(request: CreateABMetricGroupRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateABMetricGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.ABMetricIds)) {
    body['ABMetricIds'] = request.ABMetricIds;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.realtime)) {
    body['Realtime'] = request.realtime;
  }
  if (!Util.isUnset(request.sceneId)) {
    body['SceneId'] = request.sceneId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateABMetricGroup',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/abmetricgroups`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建指标组
 *
 * @param request CreateABMetricGroupRequest
 * @return CreateABMetricGroupResponse
 */
async function createABMetricGroup(request: CreateABMetricGroupRequest): CreateABMetricGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createABMetricGroupWithOptions(request, headers, runtime);
}

model CreateCalculationJobsRequest {
  ABMetricIds?: string(name='ABMetricIds', description='This parameter is required.', example='2,3,4'),
  endDate?: string(name='EndDate', description='This parameter is required.', example='2023-01-03'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-test1'),
  startDate?: string(name='StartDate', description='This parameter is required.', example='2023-01-01'),
}

model CreateCalculationJobsResponseBody = {
  calculationJobIds?: [ string ](name='CalculationJobIds'),
  requestId?: string(name='RequestId', example='8C27790E-CCA5-56BB-BA17-646295DEC0A2'),
}

model CreateCalculationJobsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateCalculationJobsResponseBody(name='body'),
}

/**
 * @summary 创建AB指标的计算任务。
 *
 * @param request CreateCalculationJobsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateCalculationJobsResponse
 */
async function createCalculationJobsWithOptions(request: CreateCalculationJobsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateCalculationJobsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.ABMetricIds)) {
    body['ABMetricIds'] = request.ABMetricIds;
  }
  if (!Util.isUnset(request.endDate)) {
    body['EndDate'] = request.endDate;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.startDate)) {
    body['StartDate'] = request.startDate;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateCalculationJobs',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/batch/calculationjobs/create`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建AB指标的计算任务。
 *
 * @param request CreateCalculationJobsRequest
 * @return CreateCalculationJobsResponse
 */
async function createCalculationJobs(request: CreateCalculationJobsRequest): CreateCalculationJobsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createCalculationJobsWithOptions(request, headers, runtime);
}

model CreateCrowdRequest {
  description?: string(name='Description', description='This parameter is required.', example='This is a test.'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-abcdefg1234'),
  label?: string(name='Label', example='os=android'),
  name?: string(name='Name', description='This parameter is required.', example='xx人群'),
  source?: string(name='Source', example='ManualInput'),
  users?: string(name='Users', example='user1,user2,user3'),
}

model CreateCrowdResponseBody = {
  crowdId?: string(name='CrowdId', example='3'),
  requestId?: string(name='RequestId', description='Id of the request', example='59CE7EC6-F268-5D71-9215-32922CC50D72'),
}

model CreateCrowdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateCrowdResponseBody(name='body'),
}

/**
 * @summary 创建人群。
 *
 * @param request CreateCrowdRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateCrowdResponse
 */
async function createCrowdWithOptions(request: CreateCrowdRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateCrowdResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.label)) {
    body['Label'] = request.label;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.source)) {
    body['Source'] = request.source;
  }
  if (!Util.isUnset(request.users)) {
    body['Users'] = request.users;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateCrowd',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/crowds`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建人群。
 *
 * @param request CreateCrowdRequest
 * @return CreateCrowdResponse
 */
async function createCrowd(request: CreateCrowdRequest): CreateCrowdResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createCrowdWithOptions(request, headers, runtime);
}

model CreateEngineConfigRequest {
  configValue?: string(name='ConfigValue', example='{}'),
  description?: string(name='Description'),
  environment?: string(name='Environment', example='Pre'),
  instanceId?: string(name='InstanceId', example='pairec-cn-***test'),
  name?: string(name='Name', example='engine_config_v1'),
}

model CreateEngineConfigResponseBody = {
  engineConfigId?: string(name='EngineConfigId', example='1'),
  requestId?: string(name='RequestId', example='E15A1443-7917-5BE0-AE70-25538ECF398D'),
}

model CreateEngineConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateEngineConfigResponseBody(name='body'),
}

/**
 * @summary 创建引擎配置
 *
 * @param request CreateEngineConfigRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateEngineConfigResponse
 */
async function createEngineConfigWithOptions(request: CreateEngineConfigRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateEngineConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.configValue)) {
    body['ConfigValue'] = request.configValue;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.environment)) {
    body['Environment'] = request.environment;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateEngineConfig',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/engineconfigs`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建引擎配置
 *
 * @param request CreateEngineConfigRequest
 * @return CreateEngineConfigResponse
 */
async function createEngineConfig(request: CreateEngineConfigRequest): CreateEngineConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createEngineConfigWithOptions(request, headers, runtime);
}

model CreateExperimentRequest {
  config?: string(name='Config', example='{"RankBy": "Score"}'),
  debugCrowdId?: string(name='DebugCrowdId', example='3'),
  debugUsers?: string(name='DebugUsers', example='1124512470******,1124512471******,1124512472******'),
  description?: string(name='Description', description='This parameter is required.', example='This is a test.'),
  experimentGroupId?: string(name='ExperimentGroupId', description='This parameter is required.', example='3'),
  flowPercent?: int32(name='FlowPercent', example='100'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-test1'),
  name?: string(name='Name', description='This parameter is required.', example='experiment_test'),
  type?: string(name='Type', description='This parameter is required.', example='Baseline'),
}

model CreateExperimentResponseBody = {
  experimentId?: string(name='ExperimentId', example='3'),
  requestId?: string(name='RequestId', description='Id of the request', example='3AAA45F6-0798-5461-9360-81D133823CE7'),
}

model CreateExperimentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateExperimentResponseBody(name='body'),
}

/**
 * @summary 创建实验。
 *
 * @param request CreateExperimentRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateExperimentResponse
 */
async function createExperimentWithOptions(request: CreateExperimentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateExperimentResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.config)) {
    body['Config'] = request.config;
  }
  if (!Util.isUnset(request.debugCrowdId)) {
    body['DebugCrowdId'] = request.debugCrowdId;
  }
  if (!Util.isUnset(request.debugUsers)) {
    body['DebugUsers'] = request.debugUsers;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.experimentGroupId)) {
    body['ExperimentGroupId'] = request.experimentGroupId;
  }
  if (!Util.isUnset(request.flowPercent)) {
    body['FlowPercent'] = request.flowPercent;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateExperiment',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/experiments`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建实验。
 *
 * @param request CreateExperimentRequest
 * @return CreateExperimentResponse
 */
async function createExperiment(request: CreateExperimentRequest): CreateExperimentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createExperimentWithOptions(request, headers, runtime);
}

model CreateExperimentGroupRequest {
  config?: string(name='Config', example='{"RankBy": "Score"}'),
  crowdId?: string(name='CrowdId', example='1'),
  crowdTargetType?: string(name='CrowdTargetType'),
  debugCrowdId?: string(name='DebugCrowdId', example='3'),
  debugUsers?: string(name='DebugUsers', example='1124512470******,1124512471******,1124512472******'),
  description?: string(name='Description', example='This is a test.'),
  distributionTimeDuration?: int32(name='DistributionTimeDuration', example='3'),
  distributionType?: string(name='DistributionType', example='UserId'),
  filter?: string(name='Filter', example='gender=male'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-test1'),
  layerId?: string(name='LayerId', description='This parameter is required.', example='3'),
  name?: string(name='Name', description='This parameter is required.', example='experiment_group_test'),
  needAA?: boolean(name='NeedAA', description='This parameter is required.', example='true'),
  randomFlow?: long(name='RandomFlow'),
  reservedBuckets?: string(name='ReservedBuckets', example='1,2,3'),
}

model CreateExperimentGroupResponseBody = {
  experimentGroupId?: string(name='ExperimentGroupId', example='3'),
  requestId?: string(name='RequestId', description='Id of the request', example='A04CB8C0-E74A-5E83-BC61-64D153574EC7'),
}

model CreateExperimentGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateExperimentGroupResponseBody(name='body'),
}

/**
 * @summary 创建实验组。
 *
 * @param request CreateExperimentGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateExperimentGroupResponse
 */
async function createExperimentGroupWithOptions(request: CreateExperimentGroupRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateExperimentGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.config)) {
    body['Config'] = request.config;
  }
  if (!Util.isUnset(request.crowdId)) {
    body['CrowdId'] = request.crowdId;
  }
  if (!Util.isUnset(request.crowdTargetType)) {
    body['CrowdTargetType'] = request.crowdTargetType;
  }
  if (!Util.isUnset(request.debugCrowdId)) {
    body['DebugCrowdId'] = request.debugCrowdId;
  }
  if (!Util.isUnset(request.debugUsers)) {
    body['DebugUsers'] = request.debugUsers;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.distributionTimeDuration)) {
    body['DistributionTimeDuration'] = request.distributionTimeDuration;
  }
  if (!Util.isUnset(request.distributionType)) {
    body['DistributionType'] = request.distributionType;
  }
  if (!Util.isUnset(request.filter)) {
    body['Filter'] = request.filter;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.layerId)) {
    body['LayerId'] = request.layerId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.needAA)) {
    body['NeedAA'] = request.needAA;
  }
  if (!Util.isUnset(request.randomFlow)) {
    body['RandomFlow'] = request.randomFlow;
  }
  if (!Util.isUnset(request.reservedBuckets)) {
    body['ReservedBuckets'] = request.reservedBuckets;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateExperimentGroup',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/experimentgroups`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建实验组。
 *
 * @param request CreateExperimentGroupRequest
 * @return CreateExperimentGroupResponse
 */
async function createExperimentGroup(request: CreateExperimentGroupRequest): CreateExperimentGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createExperimentGroupWithOptions(request, headers, runtime);
}

model CreateFeatureConsistencyCheckJobRequest {
  environment?: string(name='Environment', description='This parameter is required.', example='Pre'),
  featureConsistencyCheckJobConfigId?: string(name='FeatureConsistencyCheckJobConfigId', description='This parameter is required.', example='3'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-********'),
  samplingDuration?: int32(name='SamplingDuration', description='This parameter is required.', example='10'),
}

model CreateFeatureConsistencyCheckJobResponseBody = {
  featureConsistencyCheckJobId?: string(name='FeatureConsistencyCheckJobId', example='4'),
  requestId?: string(name='RequestId', example='7D59453C-48AA-5FC5-8848-2D373BD1A17F'),
}

model CreateFeatureConsistencyCheckJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateFeatureConsistencyCheckJobResponseBody(name='body'),
}

/**
 * @summary 创建特征一致性检查任务。
 *
 * @param request CreateFeatureConsistencyCheckJobRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateFeatureConsistencyCheckJobResponse
 */
async function createFeatureConsistencyCheckJobWithOptions(request: CreateFeatureConsistencyCheckJobRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateFeatureConsistencyCheckJobResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.environment)) {
    body['Environment'] = request.environment;
  }
  if (!Util.isUnset(request.featureConsistencyCheckJobConfigId)) {
    body['FeatureConsistencyCheckJobConfigId'] = request.featureConsistencyCheckJobConfigId;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.samplingDuration)) {
    body['SamplingDuration'] = request.samplingDuration;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateFeatureConsistencyCheckJob',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/featureconsistencycheck/jobs`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建特征一致性检查任务。
 *
 * @param request CreateFeatureConsistencyCheckJobRequest
 * @return CreateFeatureConsistencyCheckJobResponse
 */
async function createFeatureConsistencyCheckJob(request: CreateFeatureConsistencyCheckJobRequest): CreateFeatureConsistencyCheckJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createFeatureConsistencyCheckJobWithOptions(request, headers, runtime);
}

model CreateFeatureConsistencyCheckJobConfigRequest {
  compareFeature?: boolean(name='CompareFeature', description='This parameter is required.', example='true'),
  datasetId?: string(name='DatasetId'),
  datasetMountPath?: string(name='DatasetMountPath'),
  datasetName?: string(name='DatasetName'),
  datasetType?: string(name='DatasetType'),
  datasetUri?: string(name='DatasetUri'),
  defaultRoute?: string(name='DefaultRoute'),
  easServiceName?: string(name='EasServiceName', description='This parameter is required.', example='service_123'),
  easyRecPackagePath?: string(name='EasyRecPackagePath', example='oss://*******'),
  easyRecVersion?: string(name='EasyRecVersion', example='1.3.60'),
  featureDisplayExclude?: string(name='FeatureDisplayExclude', example='feature1,feature2'),
  featureLandingResourceId?: string(name='FeatureLandingResourceId', description='This parameter is required.', example='reso-********'),
  featurePriority?: string(name='FeaturePriority', example='feature1,feature2,feature3'),
  featureStoreItemId?: string(name='FeatureStoreItemId'),
  featureStoreModelId?: string(name='FeatureStoreModelId'),
  featureStoreProjectId?: string(name='FeatureStoreProjectId'),
  featureStoreProjectName?: string(name='FeatureStoreProjectName'),
  featureStoreSeqFeatureView?: string(name='FeatureStoreSeqFeatureView'),
  featureStoreUserId?: string(name='FeatureStoreUserId'),
  fgJarVersion?: string(name='FgJarVersion', example='1.0.0'),
  fgJsonFileName?: string(name='FgJsonFileName', description='This parameter is required.', example='file.json'),
  generateZip?: boolean(name='GenerateZip', description='This parameter is required.', example='true'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-********'),
  itemIdField?: string(name='ItemIdField', example='item_id'),
  itemTable?: string(name='ItemTable', example='item_table'),
  itemTablePartitionField?: string(name='ItemTablePartitionField', example='ds'),
  itemTablePartitionFieldFormat?: string(name='ItemTablePartitionFieldFormat', example='yyyymmdd'),
  name?: string(name='Name', description='This parameter is required.', example='feature_consistency_check1'),
  ossResourceId?: string(name='OssResourceId', example='reso-********'),
  predictWorkerCount?: int32(name='PredictWorkerCount'),
  predictWorkerCpu?: int32(name='PredictWorkerCpu'),
  predictWorkerMemory?: int32(name='PredictWorkerMemory'),
  sampleRate?: double(name='SampleRate', description='This parameter is required.', example='0.89'),
  sceneId?: string(name='SceneId', description='This parameter is required.', example='3'),
  securityGroupId?: string(name='SecurityGroupId'),
  serviceId?: string(name='ServiceId', description='This parameter is required.', example='4'),
  switchId?: string(name='SwitchId'),
  useFeatureStore?: boolean(name='UseFeatureStore', description='This parameter is required.'),
  userIdField?: string(name='UserIdField', example='user_id'),
  userTable?: string(name='UserTable', example='user_table'),
  userTablePartitionField?: string(name='UserTablePartitionField', example='ds'),
  userTablePartitionFieldFormat?: string(name='UserTablePartitionFieldFormat', example='yyyymmdd'),
  vpcId?: string(name='VpcId'),
  workflowName?: string(name='WorkflowName', example='work_flow_1'),
  workspaceId?: string(name='WorkspaceId'),
}

model CreateFeatureConsistencyCheckJobConfigResponseBody = {
  featureConsistencyCheckJobConfigId?: string(name='FeatureConsistencyCheckJobConfigId', example='4'),
  requestId?: string(name='RequestId', example='E15A1443-7917-5BE0-AE70-25538ECF398D'),
}

model CreateFeatureConsistencyCheckJobConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateFeatureConsistencyCheckJobConfigResponseBody(name='body'),
}

/**
 * @summary 创建特征一致性检查配置。
 *
 * @param request CreateFeatureConsistencyCheckJobConfigRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateFeatureConsistencyCheckJobConfigResponse
 */
async function createFeatureConsistencyCheckJobConfigWithOptions(request: CreateFeatureConsistencyCheckJobConfigRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateFeatureConsistencyCheckJobConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.compareFeature)) {
    body['CompareFeature'] = request.compareFeature;
  }
  if (!Util.isUnset(request.datasetId)) {
    body['DatasetId'] = request.datasetId;
  }
  if (!Util.isUnset(request.datasetMountPath)) {
    body['DatasetMountPath'] = request.datasetMountPath;
  }
  if (!Util.isUnset(request.datasetName)) {
    body['DatasetName'] = request.datasetName;
  }
  if (!Util.isUnset(request.datasetType)) {
    body['DatasetType'] = request.datasetType;
  }
  if (!Util.isUnset(request.datasetUri)) {
    body['DatasetUri'] = request.datasetUri;
  }
  if (!Util.isUnset(request.defaultRoute)) {
    body['DefaultRoute'] = request.defaultRoute;
  }
  if (!Util.isUnset(request.easServiceName)) {
    body['EasServiceName'] = request.easServiceName;
  }
  if (!Util.isUnset(request.easyRecPackagePath)) {
    body['EasyRecPackagePath'] = request.easyRecPackagePath;
  }
  if (!Util.isUnset(request.easyRecVersion)) {
    body['EasyRecVersion'] = request.easyRecVersion;
  }
  if (!Util.isUnset(request.featureDisplayExclude)) {
    body['FeatureDisplayExclude'] = request.featureDisplayExclude;
  }
  if (!Util.isUnset(request.featureLandingResourceId)) {
    body['FeatureLandingResourceId'] = request.featureLandingResourceId;
  }
  if (!Util.isUnset(request.featurePriority)) {
    body['FeaturePriority'] = request.featurePriority;
  }
  if (!Util.isUnset(request.featureStoreItemId)) {
    body['FeatureStoreItemId'] = request.featureStoreItemId;
  }
  if (!Util.isUnset(request.featureStoreModelId)) {
    body['FeatureStoreModelId'] = request.featureStoreModelId;
  }
  if (!Util.isUnset(request.featureStoreProjectId)) {
    body['FeatureStoreProjectId'] = request.featureStoreProjectId;
  }
  if (!Util.isUnset(request.featureStoreProjectName)) {
    body['FeatureStoreProjectName'] = request.featureStoreProjectName;
  }
  if (!Util.isUnset(request.featureStoreSeqFeatureView)) {
    body['FeatureStoreSeqFeatureView'] = request.featureStoreSeqFeatureView;
  }
  if (!Util.isUnset(request.featureStoreUserId)) {
    body['FeatureStoreUserId'] = request.featureStoreUserId;
  }
  if (!Util.isUnset(request.fgJarVersion)) {
    body['FgJarVersion'] = request.fgJarVersion;
  }
  if (!Util.isUnset(request.fgJsonFileName)) {
    body['FgJsonFileName'] = request.fgJsonFileName;
  }
  if (!Util.isUnset(request.generateZip)) {
    body['GenerateZip'] = request.generateZip;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.itemIdField)) {
    body['ItemIdField'] = request.itemIdField;
  }
  if (!Util.isUnset(request.itemTable)) {
    body['ItemTable'] = request.itemTable;
  }
  if (!Util.isUnset(request.itemTablePartitionField)) {
    body['ItemTablePartitionField'] = request.itemTablePartitionField;
  }
  if (!Util.isUnset(request.itemTablePartitionFieldFormat)) {
    body['ItemTablePartitionFieldFormat'] = request.itemTablePartitionFieldFormat;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.ossResourceId)) {
    body['OssResourceId'] = request.ossResourceId;
  }
  if (!Util.isUnset(request.predictWorkerCount)) {
    body['PredictWorkerCount'] = request.predictWorkerCount;
  }
  if (!Util.isUnset(request.predictWorkerCpu)) {
    body['PredictWorkerCpu'] = request.predictWorkerCpu;
  }
  if (!Util.isUnset(request.predictWorkerMemory)) {
    body['PredictWorkerMemory'] = request.predictWorkerMemory;
  }
  if (!Util.isUnset(request.sampleRate)) {
    body['SampleRate'] = request.sampleRate;
  }
  if (!Util.isUnset(request.sceneId)) {
    body['SceneId'] = request.sceneId;
  }
  if (!Util.isUnset(request.securityGroupId)) {
    body['SecurityGroupId'] = request.securityGroupId;
  }
  if (!Util.isUnset(request.serviceId)) {
    body['ServiceId'] = request.serviceId;
  }
  if (!Util.isUnset(request.switchId)) {
    body['SwitchId'] = request.switchId;
  }
  if (!Util.isUnset(request.useFeatureStore)) {
    body['UseFeatureStore'] = request.useFeatureStore;
  }
  if (!Util.isUnset(request.userIdField)) {
    body['UserIdField'] = request.userIdField;
  }
  if (!Util.isUnset(request.userTable)) {
    body['UserTable'] = request.userTable;
  }
  if (!Util.isUnset(request.userTablePartitionField)) {
    body['UserTablePartitionField'] = request.userTablePartitionField;
  }
  if (!Util.isUnset(request.userTablePartitionFieldFormat)) {
    body['UserTablePartitionFieldFormat'] = request.userTablePartitionFieldFormat;
  }
  if (!Util.isUnset(request.vpcId)) {
    body['VpcId'] = request.vpcId;
  }
  if (!Util.isUnset(request.workflowName)) {
    body['WorkflowName'] = request.workflowName;
  }
  if (!Util.isUnset(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateFeatureConsistencyCheckJobConfig',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/featureconsistencycheck/jobconfigs`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建特征一致性检查配置。
 *
 * @param request CreateFeatureConsistencyCheckJobConfigRequest
 * @return CreateFeatureConsistencyCheckJobConfigResponse
 */
async function createFeatureConsistencyCheckJobConfig(request: CreateFeatureConsistencyCheckJobConfigRequest): CreateFeatureConsistencyCheckJobConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createFeatureConsistencyCheckJobConfigWithOptions(request, headers, runtime);
}

model CreateInstanceResourceRequest {
  category?: string(name='Category', description='This parameter is required.', example='DataManagement'),
  group?: string(name='Group', description='This parameter is required.', example='storage'),
  type?: string(name='Type', description='This parameter is required.', example='OSS'),
  uri?: string(name='Uri', description='This parameter is required.', example='bucket-test-123'),
}

model CreateInstanceResourceResponseBody = {
  requestId?: string(name='RequestId', example='6CF1E160-3F36-5E73-A170-C75504F05BBC'),
  resourceId?: string(name='ResourceId', example='reso-2s416t***'),
}

model CreateInstanceResourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateInstanceResourceResponseBody(name='body'),
}

/**
 * @summary 为指定实例配置创建新的配置资源
 *
 * @param request CreateInstanceResourceRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateInstanceResourceResponse
 */
async function createInstanceResourceWithOptions(InstanceId: string, request: CreateInstanceResourceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateInstanceResourceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.category)) {
    body['Category'] = request.category;
  }
  if (!Util.isUnset(request.group)) {
    body['Group'] = request.group;
  }
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }
  if (!Util.isUnset(request.uri)) {
    body['Uri'] = request.uri;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateInstanceResource',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/resources`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 为指定实例配置创建新的配置资源
 *
 * @param request CreateInstanceResourceRequest
 * @return CreateInstanceResourceResponse
 */
async function createInstanceResource(InstanceId: string, request: CreateInstanceResourceRequest): CreateInstanceResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createInstanceResourceWithOptions(InstanceId, request, headers, runtime);
}

model CreateLaboratoryRequest {
  bucketCount?: int32(name='BucketCount', example='24'),
  bucketType?: string(name='BucketType', description='This parameter is required.', example='UidHash'),
  buckets?: string(name='Buckets', example='1,2,3,10-20'),
  debugCrowdId?: string(name='DebugCrowdId', example='3'),
  debugUsers?: string(name='DebugUsers', example='1124512470******,1124512471******,1124512472******'),
  description?: string(name='Description', example='This is a test.'),
  environment?: string(name='Environment', description='This parameter is required.', example='Daily'),
  filter?: string(name='Filter', example='filter=xxx'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-abcdefg1234'),
  name?: string(name='Name', description='This parameter is required.', example='laboratory1'),
  sceneId?: string(name='SceneId', description='This parameter is required.', example='3'),
  type?: string(name='Type', description='This parameter is required.', example='Base'),
}

model CreateLaboratoryResponseBody = {
  laboratoryId?: string(name='LaboratoryId', example='3'),
  requestId?: string(name='RequestId', description='Id of the request', example='42391E6D-822C-58F8-9F7E-D991BB86D6AD'),
}

model CreateLaboratoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateLaboratoryResponseBody(name='body'),
}

/**
 * @summary 创建实验室
 *
 * @param request CreateLaboratoryRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateLaboratoryResponse
 */
async function createLaboratoryWithOptions(request: CreateLaboratoryRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateLaboratoryResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.bucketCount)) {
    body['BucketCount'] = request.bucketCount;
  }
  if (!Util.isUnset(request.bucketType)) {
    body['BucketType'] = request.bucketType;
  }
  if (!Util.isUnset(request.buckets)) {
    body['Buckets'] = request.buckets;
  }
  if (!Util.isUnset(request.debugCrowdId)) {
    body['DebugCrowdId'] = request.debugCrowdId;
  }
  if (!Util.isUnset(request.debugUsers)) {
    body['DebugUsers'] = request.debugUsers;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.environment)) {
    body['Environment'] = request.environment;
  }
  if (!Util.isUnset(request.filter)) {
    body['Filter'] = request.filter;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.sceneId)) {
    body['SceneId'] = request.sceneId;
  }
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateLaboratory',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/laboratories`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建实验室
 *
 * @param request CreateLaboratoryRequest
 * @return CreateLaboratoryResponse
 */
async function createLaboratory(request: CreateLaboratoryRequest): CreateLaboratoryResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createLaboratoryWithOptions(request, headers, runtime);
}

model CreateLayerRequest {
  description?: string(name='Description', description='This parameter is required.', example='This is a test.'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-abcdefg1234'),
  laboratoryId?: string(name='LaboratoryId', description='This parameter is required.', example='3'),
  name?: string(name='Name', description='This parameter is required.', example='layer1'),
}

model CreateLayerResponseBody = {
  layerId?: string(name='LayerId', example='3'),
  requestId?: string(name='RequestId', description='Id of the request', example='59CE7EC6-F268-5D71-9215-32922CC50D72'),
}

model CreateLayerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateLayerResponseBody(name='body'),
}

/**
 * @summary 创建层。
 *
 * @param request CreateLayerRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateLayerResponse
 */
async function createLayerWithOptions(request: CreateLayerRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateLayerResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.laboratoryId)) {
    body['LaboratoryId'] = request.laboratoryId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateLayer',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/layers`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建层。
 *
 * @param request CreateLayerRequest
 * @return CreateLayerResponse
 */
async function createLayer(request: CreateLayerRequest): CreateLayerResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createLayerWithOptions(request, headers, runtime);
}

model CreateParamRequest {
  environment?: string(name='Environment', example='Daily'),
  instanceId?: string(name='InstanceId', example='pairec-cn-abcdefg1234'),
  name?: string(name='Name', example='home'),
  sceneId?: string(name='SceneId', example='4'),
  value?: string(name='Value', example='house'),
}

model CreateParamResponseBody = {
  paramId?: long(name='ParamId', example='4'),
  requestId?: string(name='RequestId', description='Id of the request', example='F8F613A9-DF1C-551A-88E1-397A3981A785'),
}

model CreateParamResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateParamResponseBody(name='body'),
}

/**
 * @summary 创建参数。
 *
 * @param request CreateParamRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateParamResponse
 */
async function createParamWithOptions(request: CreateParamRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateParamResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.environment)) {
    body['Environment'] = request.environment;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.sceneId)) {
    body['SceneId'] = request.sceneId;
  }
  if (!Util.isUnset(request.value)) {
    body['Value'] = request.value;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateParam',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/params`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建参数。
 *
 * @param request CreateParamRequest
 * @return CreateParamResponse
 */
async function createParam(request: CreateParamRequest): CreateParamResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createParamWithOptions(request, headers, runtime);
}

model CreateResourceRuleRequest {
  description?: string(name='Description'),
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
  metricOperationType?: string(name='MetricOperationType', description='This parameter is required.'),
  metricPullInfo?: string(name='MetricPullInfo'),
  metricPullPeriod?: string(name='MetricPullPeriod'),
  name?: string(name='Name', description='This parameter is required.'),
  ruleComputingDefinition?: string(name='RuleComputingDefinition', description='This parameter is required.'),
  ruleItems?: [ 
    {
      description?: string(name='Description'),
      maxValue?: double(name='MaxValue', description='This parameter is required.'),
      minValue?: double(name='MinValue', description='This parameter is required.'),
      name?: string(name='Name', description='This parameter is required.'),
      value?: double(name='Value', description='This parameter is required.'),
    }
  ](name='RuleItems', description='This parameter is required.'),
}

model CreateResourceRuleResponseBody = {
  requestId?: string(name='RequestId'),
  resourceRuleId?: string(name='ResourceRuleId'),
}

model CreateResourceRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateResourceRuleResponseBody(name='body'),
}

/**
 * @summary 创建资源规则
 *
 * @param request CreateResourceRuleRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateResourceRuleResponse
 */
async function createResourceRuleWithOptions(request: CreateResourceRuleRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateResourceRuleResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.metricOperationType)) {
    body['MetricOperationType'] = request.metricOperationType;
  }
  if (!Util.isUnset(request.metricPullInfo)) {
    body['MetricPullInfo'] = request.metricPullInfo;
  }
  if (!Util.isUnset(request.metricPullPeriod)) {
    body['MetricPullPeriod'] = request.metricPullPeriod;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.ruleComputingDefinition)) {
    body['RuleComputingDefinition'] = request.ruleComputingDefinition;
  }
  if (!Util.isUnset(request.ruleItems)) {
    body['RuleItems'] = request.ruleItems;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateResourceRule',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/resourcerules`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建资源规则
 *
 * @param request CreateResourceRuleRequest
 * @return CreateResourceRuleResponse
 */
async function createResourceRule(request: CreateResourceRuleRequest): CreateResourceRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createResourceRuleWithOptions(request, headers, runtime);
}

model CreateResourceRuleItemRequest {
  description?: string(name='Description'),
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
  maxValue?: double(name='MaxValue', description='This parameter is required.'),
  minValue?: double(name='MinValue', description='This parameter is required.'),
  name?: string(name='Name', description='This parameter is required.'),
  value?: double(name='Value', description='This parameter is required.'),
}

model CreateResourceRuleItemResponseBody = {
  requestId?: string(name='RequestId'),
  resourceRuleItemId?: string(name='ResourceRuleItemId'),
}

model CreateResourceRuleItemResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateResourceRuleItemResponseBody(name='body'),
}

/**
 * @summary 创建资源规则条目
 *
 * @param request CreateResourceRuleItemRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateResourceRuleItemResponse
 */
async function createResourceRuleItemWithOptions(ResourceRuleId: string, request: CreateResourceRuleItemRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateResourceRuleItemResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.maxValue)) {
    body['MaxValue'] = request.maxValue;
  }
  if (!Util.isUnset(request.minValue)) {
    body['MinValue'] = request.minValue;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.value)) {
    body['Value'] = request.value;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateResourceRuleItem',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/resourcerules/${OpenApiUtil.getEncodeParam(ResourceRuleId)}/items`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建资源规则条目
 *
 * @param request CreateResourceRuleItemRequest
 * @return CreateResourceRuleItemResponse
 */
async function createResourceRuleItem(ResourceRuleId: string, request: CreateResourceRuleItemRequest): CreateResourceRuleItemResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createResourceRuleItemWithOptions(ResourceRuleId, request, headers, runtime);
}

model CreateSceneRequest {
  description?: string(name='Description', example='This is a test.'),
  flows?: [ 
    {
      flowCode?: string(name='FlowCode', example='liuliang1'),
      flowName?: string(name='FlowName', example='流量1'),
    }
  ](name='Flows'),
  instanceId?: string(name='InstanceId', example='pairec-cn-abcdefg1234'),
  name?: string(name='Name', example='scene1'),
}

model CreateSceneResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request', example='FCF741D8-9C30-578E-807F-B935487DB34A'),
  sceneId?: string(name='SceneId', example='3'),
}

model CreateSceneResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateSceneResponseBody(name='body'),
}

/**
 * @summary 创建场景
 *
 * @param request CreateSceneRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateSceneResponse
 */
async function createSceneWithOptions(request: CreateSceneRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateSceneResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.flows)) {
    body['Flows'] = request.flows;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateScene',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/scenes`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建场景
 *
 * @param request CreateSceneRequest
 * @return CreateSceneResponse
 */
async function createScene(request: CreateSceneRequest): CreateSceneResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createSceneWithOptions(request, headers, runtime);
}

model CreateSubCrowdRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-test1'),
  source?: string(name='Source', description='This parameter is required.', example='ManualInput'),
  users?: string(name='Users', description='This parameter is required.', example='user1,user2,user3'),
}

model CreateSubCrowdResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request', example='9763624B-5FBB-5E3A-9193-B1ADB554CEAE'),
  subCrowdId?: string(name='SubCrowdId', example='3'),
}

model CreateSubCrowdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateSubCrowdResponseBody(name='body'),
}

/**
 * @summary 在指定人群下创建子人群。
 *
 * @param request CreateSubCrowdRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateSubCrowdResponse
 */
async function createSubCrowdWithOptions(CrowdId: string, request: CreateSubCrowdRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateSubCrowdResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.source)) {
    body['Source'] = request.source;
  }
  if (!Util.isUnset(request.users)) {
    body['Users'] = request.users;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateSubCrowd',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/crowds/${OpenApiUtil.getEncodeParam(CrowdId)}/subcrowds`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 在指定人群下创建子人群。
 *
 * @param request CreateSubCrowdRequest
 * @return CreateSubCrowdResponse
 */
async function createSubCrowd(CrowdId: string, request: CreateSubCrowdRequest): CreateSubCrowdResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createSubCrowdWithOptions(CrowdId, request, headers, runtime);
}

model CreateTableMetaRequest {
  description?: string(name='Description', description='This parameter is required.', example='this is a test table'),
  fields?: [ 
    {
      dataType?: string(name='DataType'),
      isDimensionField?: boolean(name='IsDimensionField', description='This parameter is required.', example='false'),
      isPartitionField?: string(name='IsPartitionField', description='This parameter is required.'),
      meaning?: string(name='Meaning', description='This parameter is required.', example='this is gender of people'),
      name?: string(name='Name', description='This parameter is required.', example='gender'),
      type?: string(name='Type', description='This parameter is required.', example='BIGINT'),
    }
  ](name='Fields', description='This parameter is required.'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-test123'),
  module?: string(name='Module', description='This parameter is required.', example='ABTest'),
  name?: string(name='Name', description='This parameter is required.', example='table_test'),
  resourceId?: string(name='ResourceId', description='This parameter is required.', example='reso-2s416t146ffjc3yefx'),
  tableName?: string(name='TableName', description='This parameter is required.', example='table_mysql'),
}

model CreateTableMetaResponseBody = {
  requestId?: string(name='RequestId', example='728C5E01-ABF6-5AA8-B9FC-B3BA05DECC77'),
  tableMetaId?: string(name='TableMetaId', example='2'),
}

model CreateTableMetaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateTableMetaResponseBody(name='body'),
}

/**
 * @summary 创建数据表。
 *
 * @param request CreateTableMetaRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateTableMetaResponse
 */
async function createTableMetaWithOptions(request: CreateTableMetaRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateTableMetaResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.fields)) {
    body['Fields'] = request.fields;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.module)) {
    body['Module'] = request.module;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.resourceId)) {
    body['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.tableName)) {
    body['TableName'] = request.tableName;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateTableMeta',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/tablemetas`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建数据表。
 *
 * @param request CreateTableMetaRequest
 * @return CreateTableMetaResponse
 */
async function createTableMeta(request: CreateTableMetaRequest): CreateTableMetaResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createTableMetaWithOptions(request, headers, runtime);
}

model CreateTrafficControlTargetRequest {
  endTime?: string(name='EndTime'),
  event?: string(name='Event'),
  itemConditionArray?: string(name='ItemConditionArray'),
  itemConditionExpress?: string(name='ItemConditionExpress'),
  itemConditionType?: string(name='ItemConditionType'),
  name?: string(name='Name'),
  newProductRegulation?: boolean(name='NewProductRegulation'),
  recallName?: string(name='RecallName'),
  startTime?: string(name='StartTime'),
  statisPeriod?: string(name='StatisPeriod'),
  status?: string(name='Status'),
  toleranceValue?: long(name='ToleranceValue'),
  trafficControlTaskId?: string(name='TrafficControlTaskId'),
  value?: float(name='Value'),
}

model CreateTrafficControlTargetResponseBody = {
  requestId?: string(name='RequestId'),
  trafficControlTargetId?: string(name='TrafficControlTargetId'),
}

model CreateTrafficControlTargetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateTrafficControlTargetResponseBody(name='body'),
}

/**
 * @summary 创建流量调控目标
 *
 * @param request CreateTrafficControlTargetRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateTrafficControlTargetResponse
 */
async function createTrafficControlTargetWithOptions(request: CreateTrafficControlTargetRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateTrafficControlTargetResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.event)) {
    body['Event'] = request.event;
  }
  if (!Util.isUnset(request.itemConditionArray)) {
    body['ItemConditionArray'] = request.itemConditionArray;
  }
  if (!Util.isUnset(request.itemConditionExpress)) {
    body['ItemConditionExpress'] = request.itemConditionExpress;
  }
  if (!Util.isUnset(request.itemConditionType)) {
    body['ItemConditionType'] = request.itemConditionType;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.newProductRegulation)) {
    body['NewProductRegulation'] = request.newProductRegulation;
  }
  if (!Util.isUnset(request.recallName)) {
    body['RecallName'] = request.recallName;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.statisPeriod)) {
    body['StatisPeriod'] = request.statisPeriod;
  }
  if (!Util.isUnset(request.status)) {
    body['Status'] = request.status;
  }
  if (!Util.isUnset(request.toleranceValue)) {
    body['ToleranceValue'] = request.toleranceValue;
  }
  if (!Util.isUnset(request.trafficControlTaskId)) {
    body['TrafficControlTaskId'] = request.trafficControlTaskId;
  }
  if (!Util.isUnset(request.value)) {
    body['Value'] = request.value;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateTrafficControlTarget',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/trafficcontroltargets`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建流量调控目标
 *
 * @param request CreateTrafficControlTargetRequest
 * @return CreateTrafficControlTargetResponse
 */
async function createTrafficControlTarget(request: CreateTrafficControlTargetRequest): CreateTrafficControlTargetResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createTrafficControlTargetWithOptions(request, headers, runtime);
}

model CreateTrafficControlTaskRequest {
  behaviorTableMetaId?: string(name='BehaviorTableMetaId', example='1'),
  controlGranularity?: string(name='ControlGranularity', example='Global'),
  controlLogic?: string(name='ControlLogic', example='Guaranteed'),
  controlType?: string(name='ControlType', example='Percent'),
  description?: string(name='Description', example='this is a test task'),
  endTime?: string(name='EndTime', example='2024-03-26'),
  executionTime?: string(name='ExecutionTime', example='TimeRange'),
  instanceId?: string(name='InstanceId', example='pairec-cn-***test'),
  itemConditionArray?: string(name='ItemConditionArray', example='[{\\\\"field\\\\":\\\\"status\\\\",\\\\"option\\\\":\\\\"=\\\\",\\\\"value\\\\":\\\\"1\\\\"}]'),
  itemConditionExpress?: string(name='ItemConditionExpress', example='status=1'),
  itemConditionType?: string(name='ItemConditionType', example='Array'),
  itemTableMetaId?: string(name='ItemTableMetaId', example='3'),
  name?: string(name='Name', example='task-1'),
  preExperimentIds?: string(name='PreExperimentIds'),
  prodExperimentIds?: string(name='ProdExperimentIds'),
  sceneId?: string(name='SceneId', example='1'),
  serviceId?: string(name='ServiceId', description='This parameter is required.'),
  startTime?: string(name='StartTime', example='2024-03-25'),
  statisBehaviorConditionArray?: string(name='StatisBehaviorConditionArray', example='[{\\\\"field\\\\":\\\\"click\\\\",\\\\"option\\\\":\\\\"<=\\\\",\\\\"value\\\\":\\\\"30\\\\"}]'),
  statisBehaviorConditionExpress?: string(name='StatisBehaviorConditionExpress', example='click=30'),
  statisBehaviorConditionType?: string(name='StatisBehaviorConditionType', example='Array'),
  trafficControlTargets?: [ 
    {
      endTime?: string(name='EndTime', example='2024-04-25'),
      event?: string(name='Event', example='click'),
      itemConditionArray?: string(name='ItemConditionArray', example='[{\\\\"field\\\\":\\\\"status\\\\",\\\\"option\\\\":\\\\"=\\\\",\\\\"value\\\\":\\\\"1\\\\"}]'),
      itemConditionExpress?: string(name='ItemConditionExpress', example='status=1'),
      itemConditionType?: string(name='ItemConditionType', example='Array'),
      name?: string(name='Name', example='target_1'),
      newProductRegulation?: boolean(name='NewProductRegulation', example='false'),
      recallName?: string(name='RecallName', example='recall_1'),
      startTime?: string(name='StartTime', example='2024-03-25'),
      statisPeriod?: string(name='StatisPeriod', example='Daily'),
      status?: string(name='Status', example='Opened'),
      toleranceValue?: long(name='ToleranceValue', example='20'),
      value?: float(name='Value', example='100'),
    }
  ](name='TrafficControlTargets'),
  userConditionArray?: string(name='UserConditionArray', example='[{\\\\"field\\\\":\\\\"gender\\\\",\\\\"option\\\\":\\\\"=\\\\",\\\\"value\\\\":\\\\"male\\\\"}]'),
  userConditionExpress?: string(name='UserConditionExpress', example='age<=30&&(3<=level<=6)&&gender=male'),
  userConditionType?: string(name='UserConditionType', example='Array'),
  userTableMetaId?: string(name='UserTableMetaId', example='2'),
}

model CreateTrafficControlTaskResponseBody = {
  requestId?: string(name='RequestId', example='42391E6D-822C-58F8-9F7E-D991BB86D6AD'),
  trafficControlTaskId?: string(name='TrafficControlTaskId', example='1'),
}

model CreateTrafficControlTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateTrafficControlTaskResponseBody(name='body'),
}

/**
 * @summary 创建流量调控任务
 *
 * @param request CreateTrafficControlTaskRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateTrafficControlTaskResponse
 */
async function createTrafficControlTaskWithOptions(request: CreateTrafficControlTaskRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateTrafficControlTaskResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.behaviorTableMetaId)) {
    body['BehaviorTableMetaId'] = request.behaviorTableMetaId;
  }
  if (!Util.isUnset(request.controlGranularity)) {
    body['ControlGranularity'] = request.controlGranularity;
  }
  if (!Util.isUnset(request.controlLogic)) {
    body['ControlLogic'] = request.controlLogic;
  }
  if (!Util.isUnset(request.controlType)) {
    body['ControlType'] = request.controlType;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.executionTime)) {
    body['ExecutionTime'] = request.executionTime;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.itemConditionArray)) {
    body['ItemConditionArray'] = request.itemConditionArray;
  }
  if (!Util.isUnset(request.itemConditionExpress)) {
    body['ItemConditionExpress'] = request.itemConditionExpress;
  }
  if (!Util.isUnset(request.itemConditionType)) {
    body['ItemConditionType'] = request.itemConditionType;
  }
  if (!Util.isUnset(request.itemTableMetaId)) {
    body['ItemTableMetaId'] = request.itemTableMetaId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.preExperimentIds)) {
    body['PreExperimentIds'] = request.preExperimentIds;
  }
  if (!Util.isUnset(request.prodExperimentIds)) {
    body['ProdExperimentIds'] = request.prodExperimentIds;
  }
  if (!Util.isUnset(request.sceneId)) {
    body['SceneId'] = request.sceneId;
  }
  if (!Util.isUnset(request.serviceId)) {
    body['ServiceId'] = request.serviceId;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.statisBehaviorConditionArray)) {
    body['StatisBehaviorConditionArray'] = request.statisBehaviorConditionArray;
  }
  if (!Util.isUnset(request.statisBehaviorConditionExpress)) {
    body['StatisBehaviorConditionExpress'] = request.statisBehaviorConditionExpress;
  }
  if (!Util.isUnset(request.statisBehaviorConditionType)) {
    body['StatisBehaviorConditionType'] = request.statisBehaviorConditionType;
  }
  if (!Util.isUnset(request.trafficControlTargets)) {
    body['TrafficControlTargets'] = request.trafficControlTargets;
  }
  if (!Util.isUnset(request.userConditionArray)) {
    body['UserConditionArray'] = request.userConditionArray;
  }
  if (!Util.isUnset(request.userConditionExpress)) {
    body['UserConditionExpress'] = request.userConditionExpress;
  }
  if (!Util.isUnset(request.userConditionType)) {
    body['UserConditionType'] = request.userConditionType;
  }
  if (!Util.isUnset(request.userTableMetaId)) {
    body['UserTableMetaId'] = request.userTableMetaId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateTrafficControlTask',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/trafficcontroltasks`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建流量调控任务
 *
 * @param request CreateTrafficControlTaskRequest
 * @return CreateTrafficControlTaskResponse
 */
async function createTrafficControlTask(request: CreateTrafficControlTaskRequest): CreateTrafficControlTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createTrafficControlTaskWithOptions(request, headers, runtime);
}

model DebugResourceRuleRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
  metricInfo?: map[string]any(name='MetricInfo', description='This parameter is required.'),
  regionId?: string(name='RegionId'),
}

model DebugResourceRuleShrinkRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
  metricInfoShrink?: string(name='MetricInfo', description='This parameter is required.'),
  regionId?: string(name='RegionId'),
}

model DebugResourceRuleResponseBody = {
  currentValues?: map[string]any(name='CurrentValues'),
  outputValues?: map[string]any(name='OutputValues'),
  requestId?: string(name='RequestId'),
}

model DebugResourceRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DebugResourceRuleResponseBody(name='body'),
}

/**
 * @summary 对指定资源规则中的计算公式进行调试
 *
 * @param tmpReq DebugResourceRuleRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DebugResourceRuleResponse
 */
async function debugResourceRuleWithOptions(ResourceRuleId: string, tmpReq: DebugResourceRuleRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DebugResourceRuleResponse {
  Util.validateModel(tmpReq);
  var request = new DebugResourceRuleShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.metricInfo)) {
    request.metricInfoShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.metricInfo, 'MetricInfo', 'json');
  }
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.metricInfoShrink)) {
    query['MetricInfo'] = request.metricInfoShrink;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DebugResourceRule',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/resourcerules/${OpenApiUtil.getEncodeParam(ResourceRuleId)}/action/debug`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 对指定资源规则中的计算公式进行调试
 *
 * @param request DebugResourceRuleRequest
 * @return DebugResourceRuleResponse
 */
async function debugResourceRule(ResourceRuleId: string, request: DebugResourceRuleRequest): DebugResourceRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return debugResourceRuleWithOptions(ResourceRuleId, request, headers, runtime);
}

model DeleteABMetricRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-test1'),
}

model DeleteABMetricResponseBody = {
  requestId?: string(name='RequestId', example='728C5E01-ABF6-5AA8-B9FC-B3BA05DECC77'),
}

model DeleteABMetricResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteABMetricResponseBody(name='body'),
}

/**
 * @summary 删除指定AB实验指标。
 *
 * @param request DeleteABMetricRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteABMetricResponse
 */
async function deleteABMetricWithOptions(ABMetricId: string, request: DeleteABMetricRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteABMetricResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteABMetric',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/abmetrics/${OpenApiUtil.getEncodeParam(ABMetricId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除指定AB实验指标。
 *
 * @param request DeleteABMetricRequest
 * @return DeleteABMetricResponse
 */
async function deleteABMetric(ABMetricId: string, request: DeleteABMetricRequest): DeleteABMetricResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteABMetricWithOptions(ABMetricId, request, headers, runtime);
}

model DeleteABMetricGroupRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-test1'),
}

model DeleteABMetricGroupResponseBody = {
  requestId?: string(name='RequestId', example='BDB621CB-A81E-5D39-8793-39A365CBCC74'),
}

model DeleteABMetricGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteABMetricGroupResponseBody(name='body'),
}

/**
 * @summary 删除AB实验指标组。
 *
 * @param request DeleteABMetricGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteABMetricGroupResponse
 */
async function deleteABMetricGroupWithOptions(ABMetricGroupId: string, request: DeleteABMetricGroupRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteABMetricGroupResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteABMetricGroup',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/abmetricgroups/${OpenApiUtil.getEncodeParam(ABMetricGroupId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除AB实验指标组。
 *
 * @param request DeleteABMetricGroupRequest
 * @return DeleteABMetricGroupResponse
 */
async function deleteABMetricGroup(ABMetricGroupId: string, request: DeleteABMetricGroupRequest): DeleteABMetricGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteABMetricGroupWithOptions(ABMetricGroupId, request, headers, runtime);
}

model DeleteCrowdRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-abcdefg1234'),
}

model DeleteCrowdResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request', example='A04CB8C0-E74A-5E83-BC61-64D153574EC7'),
}

model DeleteCrowdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteCrowdResponseBody(name='body'),
}

/**
 * @summary 删除指定人群。
 *
 * @param request DeleteCrowdRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteCrowdResponse
 */
async function deleteCrowdWithOptions(CrowdId: string, request: DeleteCrowdRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteCrowdResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteCrowd',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/crowds/${OpenApiUtil.getEncodeParam(CrowdId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除指定人群。
 *
 * @param request DeleteCrowdRequest
 * @return DeleteCrowdResponse
 */
async function deleteCrowd(CrowdId: string, request: DeleteCrowdRequest): DeleteCrowdResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteCrowdWithOptions(CrowdId, request, headers, runtime);
}

model DeleteEngineConfigRequest {
  instanceId?: string(name='InstanceId', example='pairec-cn-***test1'),
}

model DeleteEngineConfigResponseBody = {
  requestId?: string(name='RequestId', example='F7AC05FF-EDE7-5C2B-B9AE-33D6DF4178BA'),
}

model DeleteEngineConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteEngineConfigResponseBody(name='body'),
}

/**
 * @summary 删除指定推荐引擎配置。
 *
 * @param request DeleteEngineConfigRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteEngineConfigResponse
 */
async function deleteEngineConfigWithOptions(EngineConfigId: string, request: DeleteEngineConfigRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteEngineConfigResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteEngineConfig',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/engineconfigs/${OpenApiUtil.getEncodeParam(EngineConfigId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除指定推荐引擎配置。
 *
 * @param request DeleteEngineConfigRequest
 * @return DeleteEngineConfigResponse
 */
async function deleteEngineConfig(EngineConfigId: string, request: DeleteEngineConfigRequest): DeleteEngineConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteEngineConfigWithOptions(EngineConfigId, request, headers, runtime);
}

model DeleteExperimentRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-abcdefg1234'),
}

model DeleteExperimentResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request', example='2A734D87-2212-5C84-B63A-1AC87CA843D4'),
}

model DeleteExperimentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteExperimentResponseBody(name='body'),
}

/**
 * @summary 删除实验。
 *
 * @param request DeleteExperimentRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteExperimentResponse
 */
async function deleteExperimentWithOptions(ExperimentId: string, request: DeleteExperimentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteExperimentResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteExperiment',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/experiments/${OpenApiUtil.getEncodeParam(ExperimentId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除实验。
 *
 * @param request DeleteExperimentRequest
 * @return DeleteExperimentResponse
 */
async function deleteExperiment(ExperimentId: string, request: DeleteExperimentRequest): DeleteExperimentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteExperimentWithOptions(ExperimentId, request, headers, runtime);
}

model DeleteExperimentGroupRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-abcdefg1234'),
}

model DeleteExperimentGroupResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request', example='A009D9BE-C85E-57B2-AE05-BD78BB6EBF50'),
}

model DeleteExperimentGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteExperimentGroupResponseBody(name='body'),
}

/**
 * @summary 删除指定实验组。
 *
 * @param request DeleteExperimentGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteExperimentGroupResponse
 */
async function deleteExperimentGroupWithOptions(ExperimentGroupId: string, request: DeleteExperimentGroupRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteExperimentGroupResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteExperimentGroup',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/experimentgroups/${OpenApiUtil.getEncodeParam(ExperimentGroupId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除指定实验组。
 *
 * @param request DeleteExperimentGroupRequest
 * @return DeleteExperimentGroupResponse
 */
async function deleteExperimentGroup(ExperimentGroupId: string, request: DeleteExperimentGroupRequest): DeleteExperimentGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteExperimentGroupWithOptions(ExperimentGroupId, request, headers, runtime);
}

model DeleteInstanceResourceResponseBody = {
  requestId?: string(name='RequestId', example='7D59453C-48AA-5FC5-8848-2D373BD1A17F'),
}

model DeleteInstanceResourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteInstanceResourceResponseBody(name='body'),
}

/**
 * @summary 删除指定实例下的指定配置资源。
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteInstanceResourceResponse
 */
async function deleteInstanceResourceWithOptions(InstanceId: string, ResourceId: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteInstanceResourceResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'DeleteInstanceResource',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/resources/${OpenApiUtil.getEncodeParam(ResourceId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除指定实例下的指定配置资源。
 *
 * @return DeleteInstanceResourceResponse
 */
async function deleteInstanceResource(InstanceId: string, ResourceId: string): DeleteInstanceResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteInstanceResourceWithOptions(InstanceId, ResourceId, headers, runtime);
}

model DeleteLaboratoryRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-abcdefg1234'),
}

model DeleteLaboratoryResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request', example='1C0898E5-9220-5443-B2D9-445FF0688215'),
}

model DeleteLaboratoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteLaboratoryResponseBody(name='body'),
}

/**
 * @summary 删除实验室。
 *
 * @param request DeleteLaboratoryRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteLaboratoryResponse
 */
async function deleteLaboratoryWithOptions(LaboratoryId: string, request: DeleteLaboratoryRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteLaboratoryResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteLaboratory',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/laboratories/${OpenApiUtil.getEncodeParam(LaboratoryId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除实验室。
 *
 * @param request DeleteLaboratoryRequest
 * @return DeleteLaboratoryResponse
 */
async function deleteLaboratory(LaboratoryId: string, request: DeleteLaboratoryRequest): DeleteLaboratoryResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteLaboratoryWithOptions(LaboratoryId, request, headers, runtime);
}

model DeleteLayerRequest {
  instanceId?: string(name='InstanceId', example='pairec-cn-abcdefg1234'),
}

model DeleteLayerResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request', example='8F457D79-C4A2-5E8C-83E4-0D089456E2AC'),
}

model DeleteLayerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteLayerResponseBody(name='body'),
}

/**
 * @summary 删除层。
 *
 * @param request DeleteLayerRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteLayerResponse
 */
async function deleteLayerWithOptions(LayerId: string, request: DeleteLayerRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteLayerResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteLayer',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/layers/${OpenApiUtil.getEncodeParam(LayerId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除层。
 *
 * @param request DeleteLayerRequest
 * @return DeleteLayerResponse
 */
async function deleteLayer(LayerId: string, request: DeleteLayerRequest): DeleteLayerResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteLayerWithOptions(LayerId, request, headers, runtime);
}

model DeleteParamRequest {
  instanceId?: string(name='InstanceId', example='pairec-cn-abcdefg1234'),
}

model DeleteParamResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request', example='F0AB6527-093F-5C44-B3BD-42C8C210C619'),
}

model DeleteParamResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteParamResponseBody(name='body'),
}

/**
 * @summary 删除指定参数。
 *
 * @param request DeleteParamRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteParamResponse
 */
async function deleteParamWithOptions(ParamId: string, request: DeleteParamRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteParamResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteParam',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/params/${OpenApiUtil.getEncodeParam(ParamId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除指定参数。
 *
 * @param request DeleteParamRequest
 * @return DeleteParamResponse
 */
async function deleteParam(ParamId: string, request: DeleteParamRequest): DeleteParamResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteParamWithOptions(ParamId, request, headers, runtime);
}

model DeleteResourceRuleRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
}

model DeleteResourceRuleResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteResourceRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteResourceRuleResponseBody(name='body'),
}

/**
 * @summary 删除资源规则
 *
 * @param request DeleteResourceRuleRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteResourceRuleResponse
 */
async function deleteResourceRuleWithOptions(ResourceRuleId: string, request: DeleteResourceRuleRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteResourceRuleResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteResourceRule',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/resourcerules/${OpenApiUtil.getEncodeParam(ResourceRuleId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除资源规则
 *
 * @param request DeleteResourceRuleRequest
 * @return DeleteResourceRuleResponse
 */
async function deleteResourceRule(ResourceRuleId: string, request: DeleteResourceRuleRequest): DeleteResourceRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteResourceRuleWithOptions(ResourceRuleId, request, headers, runtime);
}

model DeleteResourceRuleItemRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
}

model DeleteResourceRuleItemResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteResourceRuleItemResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteResourceRuleItemResponseBody(name='body'),
}

/**
 * @summary 删除资源规则条目
 *
 * @param request DeleteResourceRuleItemRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteResourceRuleItemResponse
 */
async function deleteResourceRuleItemWithOptions(ResourceRuleId: string, ResourceRuleItemId: string, request: DeleteResourceRuleItemRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteResourceRuleItemResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteResourceRuleItem',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/resourcerules/${OpenApiUtil.getEncodeParam(ResourceRuleId)}/items/${OpenApiUtil.getEncodeParam(ResourceRuleItemId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除资源规则条目
 *
 * @param request DeleteResourceRuleItemRequest
 * @return DeleteResourceRuleItemResponse
 */
async function deleteResourceRuleItem(ResourceRuleId: string, ResourceRuleItemId: string, request: DeleteResourceRuleItemRequest): DeleteResourceRuleItemResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteResourceRuleItemWithOptions(ResourceRuleId, ResourceRuleItemId, request, headers, runtime);
}

model DeleteSceneRequest {
  instanceId?: string(name='InstanceId', example='pairec-cn-abcdefg1234'),
}

model DeleteSceneResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request', example='D75C43DC-3D3A-5CC8-9AAC-8C77306C433B'),
}

model DeleteSceneResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteSceneResponseBody(name='body'),
}

/**
 * @summary 删除场景
 *
 * @param request DeleteSceneRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteSceneResponse
 */
async function deleteSceneWithOptions(SceneId: string, request: DeleteSceneRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteSceneResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteScene',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/scenes/${OpenApiUtil.getEncodeParam(SceneId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除场景
 *
 * @param request DeleteSceneRequest
 * @return DeleteSceneResponse
 */
async function deleteScene(SceneId: string, request: DeleteSceneRequest): DeleteSceneResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteSceneWithOptions(SceneId, request, headers, runtime);
}

model DeleteSubCrowdRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-abcdefg1234'),
}

model DeleteSubCrowdResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request', example='EE97D06A-2AA0-5AD9-B6CF-8A267924D691'),
}

model DeleteSubCrowdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteSubCrowdResponseBody(name='body'),
}

/**
 * @summary 删除指定人群下的指定子人群。
 *
 * @param request DeleteSubCrowdRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteSubCrowdResponse
 */
async function deleteSubCrowdWithOptions(CrowdId: string, SubCrowdId: string, request: DeleteSubCrowdRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteSubCrowdResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteSubCrowd',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/crowds/${OpenApiUtil.getEncodeParam(CrowdId)}/subcrowds/${OpenApiUtil.getEncodeParam(SubCrowdId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除指定人群下的指定子人群。
 *
 * @param request DeleteSubCrowdRequest
 * @return DeleteSubCrowdResponse
 */
async function deleteSubCrowd(CrowdId: string, SubCrowdId: string, request: DeleteSubCrowdRequest): DeleteSubCrowdResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteSubCrowdWithOptions(CrowdId, SubCrowdId, request, headers, runtime);
}

model DeleteTableMetaRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
}

model DeleteTableMetaResponseBody = {
  requestId?: string(name='RequestId', example='728C5E01-ABF6-5AA8-B9FC-B3BA05DECC77'),
}

model DeleteTableMetaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteTableMetaResponseBody(name='body'),
}

/**
 * @summary 删除数据表。
 *
 * @param request DeleteTableMetaRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteTableMetaResponse
 */
async function deleteTableMetaWithOptions(TableMetaId: string, request: DeleteTableMetaRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteTableMetaResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteTableMeta',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/tablemetas/${OpenApiUtil.getEncodeParam(TableMetaId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除数据表。
 *
 * @param request DeleteTableMetaRequest
 * @return DeleteTableMetaResponse
 */
async function deleteTableMeta(TableMetaId: string, request: DeleteTableMetaRequest): DeleteTableMetaResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteTableMetaWithOptions(TableMetaId, request, headers, runtime);
}

model DeleteTrafficControlTargetRequest {
  instanceId?: string(name='InstanceId'),
}

model DeleteTrafficControlTargetResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteTrafficControlTargetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteTrafficControlTargetResponseBody(name='body'),
}

/**
 * @summary 更新流量调控目标
 *
 * @param request DeleteTrafficControlTargetRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteTrafficControlTargetResponse
 */
async function deleteTrafficControlTargetWithOptions(TrafficControlTargetId: string, request: DeleteTrafficControlTargetRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteTrafficControlTargetResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteTrafficControlTarget',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/trafficcontroltargets/${OpenApiUtil.getEncodeParam(TrafficControlTargetId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新流量调控目标
 *
 * @param request DeleteTrafficControlTargetRequest
 * @return DeleteTrafficControlTargetResponse
 */
async function deleteTrafficControlTarget(TrafficControlTargetId: string, request: DeleteTrafficControlTargetRequest): DeleteTrafficControlTargetResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteTrafficControlTargetWithOptions(TrafficControlTargetId, request, headers, runtime);
}

model DeleteTrafficControlTaskRequest {
  instanceId?: string(name='InstanceId'),
}

model DeleteTrafficControlTaskResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteTrafficControlTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteTrafficControlTaskResponseBody(name='body'),
}

/**
 * @summary 删除指定的流量调控任务
 *
 * @param request DeleteTrafficControlTaskRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteTrafficControlTaskResponse
 */
async function deleteTrafficControlTaskWithOptions(TrafficControlTaskId: string, request: DeleteTrafficControlTaskRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteTrafficControlTaskResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteTrafficControlTask',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/trafficcontroltasks/${OpenApiUtil.getEncodeParam(TrafficControlTaskId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除指定的流量调控任务
 *
 * @param request DeleteTrafficControlTaskRequest
 * @return DeleteTrafficControlTaskResponse
 */
async function deleteTrafficControlTask(TrafficControlTaskId: string, request: DeleteTrafficControlTaskRequest): DeleteTrafficControlTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteTrafficControlTaskWithOptions(TrafficControlTaskId, request, headers, runtime);
}

model GenerateTrafficControlTaskCodeRequest {
  environment?: string(name='Environment'),
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
}

model GenerateTrafficControlTaskCodeResponseBody = {
  code?: string(name='Code'),
  preNeedConfig?: boolean(name='PreNeedConfig'),
  requestId?: string(name='RequestId'),
}

model GenerateTrafficControlTaskCodeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GenerateTrafficControlTaskCodeResponseBody(name='body'),
}

/**
 * @summary 产生流量调控的相关代码
 *
 * @param request GenerateTrafficControlTaskCodeRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GenerateTrafficControlTaskCodeResponse
 */
async function generateTrafficControlTaskCodeWithOptions(TrafficControlTaskId: string, request: GenerateTrafficControlTaskCodeRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GenerateTrafficControlTaskCodeResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.environment)) {
    body['Environment'] = request.environment;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GenerateTrafficControlTaskCode',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/trafficcontroltasks/${OpenApiUtil.getEncodeParam(TrafficControlTaskId)}/action/generatecode`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 产生流量调控的相关代码
 *
 * @param request GenerateTrafficControlTaskCodeRequest
 * @return GenerateTrafficControlTaskCodeResponse
 */
async function generateTrafficControlTaskCode(TrafficControlTaskId: string, request: GenerateTrafficControlTaskCodeRequest): GenerateTrafficControlTaskCodeResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return generateTrafficControlTaskCodeWithOptions(TrafficControlTaskId, request, headers, runtime);
}

model GenerateTrafficControlTaskConfigRequest {
  instanceId?: string(name='InstanceId'),
}

model GenerateTrafficControlTaskConfigResponseBody = {
  config?: string(name='Config'),
  requestId?: string(name='RequestId'),
}

model GenerateTrafficControlTaskConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GenerateTrafficControlTaskConfigResponseBody(name='body'),
}

/**
 * @summary 产生流量调控的相关召回配置
 *
 * @param request GenerateTrafficControlTaskConfigRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GenerateTrafficControlTaskConfigResponse
 */
async function generateTrafficControlTaskConfigWithOptions(TrafficControlTaskId: string, request: GenerateTrafficControlTaskConfigRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GenerateTrafficControlTaskConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GenerateTrafficControlTaskConfig',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/trafficcontroltasks/${OpenApiUtil.getEncodeParam(TrafficControlTaskId)}/action/generateconfig`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 产生流量调控的相关召回配置
 *
 * @param request GenerateTrafficControlTaskConfigRequest
 * @return GenerateTrafficControlTaskConfigResponse
 */
async function generateTrafficControlTaskConfig(TrafficControlTaskId: string, request: GenerateTrafficControlTaskConfigRequest): GenerateTrafficControlTaskConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return generateTrafficControlTaskConfigWithOptions(TrafficControlTaskId, request, headers, runtime);
}

model GetABMetricRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-test1'),
}

model GetABMetricResponseBody = {
  definition?: string(name='Definition', example='sum(click_cnt)'),
  description?: string(name='Description'),
  leftMetricId?: string(name='LeftMetricId', example='3'),
  name?: string(name='Name', example='pv'),
  operator?: string(name='Operator', example='Division'),
  realtime?: string(name='Realtime', example='false'),
  requestId?: string(name='RequestId', example='728C5E01-ABF6-5AA8-B9FC-B3BA05DECC77'),
  resultResourceId?: string(name='ResultResourceId', example='5'),
  resultTableMetaId?: string(name='ResultTableMetaId', example='3'),
  rightMetricId?: string(name='RightMetricId', example='2'),
  sceneId?: string(name='SceneId', example='1'),
  sceneName?: string(name='SceneName', example='home_feed'),
  statisticsCycle?: int32(name='StatisticsCycle', example='1'),
  tableMetaId?: string(name='TableMetaId', example='2'),
  type?: string(name='Type', example='Single'),
}

model GetABMetricResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetABMetricResponseBody(name='body'),
}

/**
 * @summary 获取AB Test实验指标详细信息。
 *
 * @param request GetABMetricRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetABMetricResponse
 */
async function getABMetricWithOptions(ABMetricId: string, request: GetABMetricRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetABMetricResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetABMetric',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/abmetrics/${OpenApiUtil.getEncodeParam(ABMetricId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取AB Test实验指标详细信息。
 *
 * @param request GetABMetricRequest
 * @return GetABMetricResponse
 */
async function getABMetric(ABMetricId: string, request: GetABMetricRequest): GetABMetricResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getABMetricWithOptions(ABMetricId, request, headers, runtime);
}

model GetABMetricGroupRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-test1'),
}

model GetABMetricGroupResponseBody = {
  ABMetricIds?: string(name='ABMetricIds', example='1,2'),
  ABMetricNames?: string(name='ABMetricNames', example='pv,uv'),
  description?: string(name='Description'),
  name?: string(name='Name', example='visits'),
  owner?: string(name='Owner', example='2799614***'),
  realtime?: boolean(name='Realtime', example='false'),
  requestId?: string(name='RequestId', example='01D22D08-BA20-5F35-8302-99115F288220'),
  sceneId?: string(name='SceneId', example='1'),
}

model GetABMetricGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetABMetricGroupResponseBody(name='body'),
}

/**
 * @summary 获取AB实验指标组详细信息。
 *
 * @param request GetABMetricGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetABMetricGroupResponse
 */
async function getABMetricGroupWithOptions(ABMetricGroupId: string, request: GetABMetricGroupRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetABMetricGroupResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetABMetricGroup',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/abmetricgroups/${OpenApiUtil.getEncodeParam(ABMetricGroupId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取AB实验指标组详细信息。
 *
 * @param request GetABMetricGroupRequest
 * @return GetABMetricGroupResponse
 */
async function getABMetricGroup(ABMetricGroupId: string, request: GetABMetricGroupRequest): GetABMetricGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getABMetricGroupWithOptions(ABMetricGroupId, request, headers, runtime);
}

model GetCalculationJobRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-test1'),
}

model GetCalculationJobResponseBody = {
  ABMetricId?: string(name='ABMetricId', example='1'),
  ABMetricName?: string(name='ABMetricName', example='pv'),
  bizDate?: string(name='BizDate', example='2021-12-15'),
  config?: string(name='Config', example='{}'),
  gmtRanTime?: string(name='GmtRanTime', example='2021-12-15T23:24:33.132+08:00'),
  jobMessage?: [ string ](name='JobMessage'),
  jobSource?: string(name='JobSource', example='CronOffline'),
  requestId?: string(name='RequestId', example='7D59453C-48AA-5FC5-8848-2D373BD1A17F'),
  status?: string(name='Status', example='Success'),
}

model GetCalculationJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetCalculationJobResponseBody(name='body'),
}

/**
 * @summary 获取指定计算任务详细信息。
 *
 * @param request GetCalculationJobRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetCalculationJobResponse
 */
async function getCalculationJobWithOptions(CalculationJobId: string, request: GetCalculationJobRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetCalculationJobResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetCalculationJob',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/calculationjobs/${OpenApiUtil.getEncodeParam(CalculationJobId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取指定计算任务详细信息。
 *
 * @param request GetCalculationJobRequest
 * @return GetCalculationJobResponse
 */
async function getCalculationJob(CalculationJobId: string, request: GetCalculationJobRequest): GetCalculationJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getCalculationJobWithOptions(CalculationJobId, request, headers, runtime);
}

model GetEngineConfigRequest {
  instanceId?: string(name='InstanceId', example='pairec-cn-***test'),
}

model GetEngineConfigResponseBody = {
  configValue?: string(name='ConfigValue', example='{}'),
  description?: string(name='Description'),
  environment?: string(name='Environment', example='Pre'),
  gmtCreateTime?: string(name='GmtCreateTime', example='2024-01-03T02:28:00.000Z'),
  gmtModifiedTime?: string(name='GmtModifiedTime', example='2024-08-27T12:00:00Z'),
  gmtReleasedTime?: string(name='GmtReleasedTime', example='2024-01-03 02:28:00'),
  name?: string(name='Name', example='engine_config_v1'),
  requestId?: string(name='RequestId', example='59CE7EC6-F268-5D71-9215-32922CC50D72'),
  status?: string(name='Status', example='Released'),
}

model GetEngineConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetEngineConfigResponseBody(name='body'),
}

/**
 * @summary 获取引擎配置详细信息。
 *
 * @param request GetEngineConfigRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetEngineConfigResponse
 */
async function getEngineConfigWithOptions(EngineConfigId: string, request: GetEngineConfigRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetEngineConfigResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetEngineConfig',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/engineconfigs/${OpenApiUtil.getEncodeParam(EngineConfigId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取引擎配置详细信息。
 *
 * @param request GetEngineConfigRequest
 * @return GetEngineConfigResponse
 */
async function getEngineConfig(EngineConfigId: string, request: GetEngineConfigRequest): GetEngineConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getEngineConfigWithOptions(EngineConfigId, request, headers, runtime);
}

model GetExperimentRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-test1'),
}

model GetExperimentResponseBody = {
  aliasExperimentId?: string(name='AliasExperimentId', example='L1#EG1#E1'),
  buckets?: string(name='Buckets', example='1,2,3'),
  config?: string(name='Config', example='{}'),
  debugCrowdId?: string(name='DebugCrowdId', example='3'),
  debugUsers?: string(name='DebugUsers', example='uid1,uid2,uid3'),
  description?: string(name='Description', example='This is a test.'),
  experimentGroupId?: string(name='ExperimentGroupId', example='3'),
  flowPercent?: int32(name='FlowPercent', example='100'),
  gmtCreateTime?: string(name='GmtCreateTime', example='2021-12-15T23:24:33.132+08:00'),
  gmtModifiedTime?: string(name='GmtModifiedTime', example='2021-12-15T23:24:33.132+08:00'),
  laboratoryId?: string(name='LaboratoryId', example='3'),
  layerId?: string(name='LayerId', example='3'),
  name?: string(name='Name', example='experiment_test1'),
  requestId?: string(name='RequestId', description='Id of the request', example='74D958EF-3598-56FA-8296-FF1575CE43DF'),
  sceneId?: string(name='SceneId', example='3'),
  status?: string(name='Status', example='Offline'),
  type?: string(name='Type', example='Baseline'),
}

model GetExperimentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetExperimentResponseBody(name='body'),
}

/**
 * @summary 获取实验详细信息。
 *
 * @param request GetExperimentRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetExperimentResponse
 */
async function getExperimentWithOptions(ExperimentId: string, request: GetExperimentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetExperimentResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetExperiment',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/experiments/${OpenApiUtil.getEncodeParam(ExperimentId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取实验详细信息。
 *
 * @param request GetExperimentRequest
 * @return GetExperimentResponse
 */
async function getExperiment(ExperimentId: string, request: GetExperimentRequest): GetExperimentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getExperimentWithOptions(ExperimentId, request, headers, runtime);
}

model GetExperimentGroupRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-abcdefg1234'),
}

model GetExperimentGroupResponseBody = {
  config?: string(name='Config', example='{"RankBy": "Score"}'),
  crowdId?: string(name='CrowdId', example='3'),
  crowdTargetType?: string(name='CrowdTargetType'),
  debugCrowdId?: string(name='DebugCrowdId', example='4'),
  debugUsers?: string(name='DebugUsers', example='1124512470******,1124512471******,1124512472******'),
  description?: string(name='Description', example='This is a test.'),
  distributionTimeDuration?: int32(name='DistributionTimeDuration', example='5'),
  distributionType?: string(name='DistributionType', example='UserId'),
  filter?: string(name='Filter', example='gender=female'),
  holdingBuckets?: string(name='HoldingBuckets'),
  laboratoryId?: string(name='LaboratoryId', example='4'),
  layerId?: string(name='LayerId', example='3'),
  name?: string(name='Name', example='experiment_group1'),
  needAA?: boolean(name='NeedAA', example='true'),
  owner?: string(name='Owner', example='1124512470******'),
  randomFlow?: long(name='RandomFlow'),
  requestId?: string(name='RequestId', description='Id of the request', example='BDB621CB-A81E-5D39-8793-39A365CBCC74'),
  reservedBuckets?: string(name='ReservedBuckets', example='1,2,3,4'),
  sceneId?: string(name='SceneId', example='1'),
  status?: string(name='Status', example='Offline'),
}

model GetExperimentGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetExperimentGroupResponseBody(name='body'),
}

/**
 * @summary 获取指定实验组详细信息。
 *
 * @param request GetExperimentGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetExperimentGroupResponse
 */
async function getExperimentGroupWithOptions(ExperimentGroupId: string, request: GetExperimentGroupRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetExperimentGroupResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetExperimentGroup',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/experimentgroups/${OpenApiUtil.getEncodeParam(ExperimentGroupId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取指定实验组详细信息。
 *
 * @param request GetExperimentGroupRequest
 * @return GetExperimentGroupResponse
 */
async function getExperimentGroup(ExperimentGroupId: string, request: GetExperimentGroupRequest): GetExperimentGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getExperimentGroupWithOptions(ExperimentGroupId, request, headers, runtime);
}

model GetFeatureConsistencyCheckJobRequest {
  instanceId?: string(name='InstanceId', example='pairec-cn-********'),
}

model GetFeatureConsistencyCheckJobResponseBody = {
  config?: string(name='Config', example='{}'),
  featureConsistencyCheckJobConfigId?: string(name='FeatureConsistencyCheckJobConfigId', example='5'),
  featureConsistencyCheckJobConfigName?: string(name='FeatureConsistencyCheckJobConfigName', example='feature_consistency_check_1'),
  gmtEndTime?: string(name='GmtEndTime', example='2021-12-15T23:24:33.132+08:00'),
  gmtStartTime?: string(name='GmtStartTime', example='2021-12-15T23:24:33.132+08:00'),
  logs?: [ string ](name='Logs'),
  requestId?: string(name='RequestId', example='A04CB8C0-E74A-5E83-BC61-64D153574EC7'),
  status?: string(name='Status', example='Running'),
}

model GetFeatureConsistencyCheckJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetFeatureConsistencyCheckJobResponseBody(name='body'),
}

/**
 * @summary 获取特征一致性检查任务详细信息。
 *
 * @param request GetFeatureConsistencyCheckJobRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetFeatureConsistencyCheckJobResponse
 */
async function getFeatureConsistencyCheckJobWithOptions(FeatureConsistencyCheckJobId: string, request: GetFeatureConsistencyCheckJobRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetFeatureConsistencyCheckJobResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetFeatureConsistencyCheckJob',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/featureconsistencycheck/jobs/${OpenApiUtil.getEncodeParam(FeatureConsistencyCheckJobId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取特征一致性检查任务详细信息。
 *
 * @param request GetFeatureConsistencyCheckJobRequest
 * @return GetFeatureConsistencyCheckJobResponse
 */
async function getFeatureConsistencyCheckJob(FeatureConsistencyCheckJobId: string, request: GetFeatureConsistencyCheckJobRequest): GetFeatureConsistencyCheckJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getFeatureConsistencyCheckJobWithOptions(FeatureConsistencyCheckJobId, request, headers, runtime);
}

model GetFeatureConsistencyCheckJobConfigRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-********'),
}

model GetFeatureConsistencyCheckJobConfigResponseBody = {
  compareFeature?: boolean(name='CompareFeature', example='true'),
  datasetId?: string(name='DatasetId'),
  datasetMountPath?: string(name='DatasetMountPath'),
  datasetName?: string(name='DatasetName'),
  datasetType?: string(name='DatasetType'),
  datasetUri?: string(name='DatasetUri'),
  defaultRoute?: string(name='DefaultRoute'),
  easServiceName?: string(name='EasServiceName', example='eas_service_1'),
  easyRecPackagePath?: string(name='EasyRecPackagePath', example='oss://*******'),
  easyRecVersion?: string(name='EasyRecVersion', example='1.3.60'),
  featureDisplayExclude?: string(name='FeatureDisplayExclude', example='feature1,feature2'),
  featureLandingResourceId?: string(name='FeatureLandingResourceId', example='reso-********'),
  featureLandingResourceUri?: string(name='FeatureLandingResourceUri', example='mc_project_1'),
  featurePriority?: string(name='FeaturePriority', example='feature1,feature2,feature3'),
  featureStoreItemId?: string(name='FeatureStoreItemId'),
  featureStoreModelId?: string(name='FeatureStoreModelId'),
  featureStoreProjectId?: string(name='FeatureStoreProjectId'),
  featureStoreProjectName?: string(name='FeatureStoreProjectName'),
  featureStoreSeqFeatureView?: string(name='FeatureStoreSeqFeatureView'),
  featureStoreUserId?: string(name='FeatureStoreUserId'),
  fgJarVersion?: string(name='FgJarVersion', example='1.0.0'),
  fgJsonFileName?: string(name='FgJsonFileName', example='file.json'),
  generateZip?: boolean(name='GenerateZip', example='true'),
  gmtCreateTime?: string(name='GmtCreateTime', example='2021-12-15T23:24:33.132+08:00'),
  gmtModifiedTime?: string(name='GmtModifiedTime', example='2021-12-15T23:24:33.132+08:00'),
  itemIdField?: string(name='ItemIdField', example='item_id'),
  itemTable?: string(name='ItemTable', example='item_table'),
  itemTablePartitionField?: string(name='ItemTablePartitionField', example='ds'),
  itemTablePartitionFieldFormat?: string(name='ItemTablePartitionFieldFormat', example='yyyymmdd'),
  latestJobGmtSamplingEndTime?: string(name='LatestJobGmtSamplingEndTime', example='2021-12-15T23:24:33.132+08:00'),
  latestJobGmtSamplingStartTime?: string(name='LatestJobGmtSamplingStartTime', example='2021-12-15T23:24:33.132+08:00'),
  latestJobId?: string(name='LatestJobId', example='3'),
  name?: string(name='Name', example='feature_consistency_check1'),
  ossBucket?: string(name='OssBucket', example='oss_bucket_1'),
  ossResourceId?: string(name='OssResourceId', example='reso-********'),
  predictWorkerCount?: int32(name='PredictWorkerCount'),
  predictWorkerCpu?: int32(name='PredictWorkerCpu'),
  predictWorkerMemory?: int32(name='PredictWorkerMemory'),
  requestId?: string(name='RequestId', example='728C5E01-ABF6-5AA8-B9FC-B3BA05DECC77'),
  sampleRate?: string(name='SampleRate', example='0.89'),
  sceneId?: string(name='SceneId', example='3'),
  sceneName?: string(name='SceneName', example='scene1'),
  securityGroupId?: string(name='SecurityGroupId'),
  serviceId?: string(name='ServiceId', example='4'),
  serviceName?: string(name='ServiceName', example='service1'),
  status?: string(name='Status', example='Editable'),
  switchId?: string(name='SwitchId'),
  useFeatureStore?: boolean(name='UseFeatureStore'),
  userIdField?: string(name='UserIdField', example='user_id'),
  userTable?: string(name='UserTable', example='user_table'),
  userTablePartitionField?: string(name='UserTablePartitionField', example='ds'),
  userTablePartitionFieldFormat?: string(name='UserTablePartitionFieldFormat', example='yyyymmdd'),
  vpcId?: string(name='VpcId'),
  workflowName?: string(name='WorkflowName', example='work_flow_1'),
  workspaceId?: string(name='WorkspaceId'),
}

model GetFeatureConsistencyCheckJobConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetFeatureConsistencyCheckJobConfigResponseBody(name='body'),
}

/**
 * @summary 获取特征一致性检测配置详情。
 *
 * @param request GetFeatureConsistencyCheckJobConfigRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetFeatureConsistencyCheckJobConfigResponse
 */
async function getFeatureConsistencyCheckJobConfigWithOptions(FeatureConsistencyCheckJobConfigId: string, request: GetFeatureConsistencyCheckJobConfigRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetFeatureConsistencyCheckJobConfigResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetFeatureConsistencyCheckJobConfig',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/featureconsistencycheck/jobconfigs/${OpenApiUtil.getEncodeParam(FeatureConsistencyCheckJobConfigId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取特征一致性检测配置详情。
 *
 * @param request GetFeatureConsistencyCheckJobConfigRequest
 * @return GetFeatureConsistencyCheckJobConfigResponse
 */
async function getFeatureConsistencyCheckJobConfig(FeatureConsistencyCheckJobConfigId: string, request: GetFeatureConsistencyCheckJobConfigRequest): GetFeatureConsistencyCheckJobConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getFeatureConsistencyCheckJobConfigWithOptions(FeatureConsistencyCheckJobConfigId, request, headers, runtime);
}

model GetInstanceResponseBody = {
  chargeType?: string(name='ChargeType', example='Subscription'),
  commodityCode?: string(name='CommodityCode', example='airec_developers_public_cn'),
  config?: {
    dataManagements?: [ 
      {
        componentCode?: string(name='ComponentCode', example='storage'),
        meta?: map[string]any(name='Meta'),
        type?: string(name='Type', example='OSS'),
      }
    ](name='DataManagements'),
    engines?: [ 
      {
        componentCode?: string(name='ComponentCode', example='feature'),
        meta?: map[string]any(name='Meta'),
        type?: string(name='Type', example='Hologres'),
      }
    ](name='Engines'),
    monitors?: [ 
      {
        componentCode?: string(name='ComponentCode', example='featuresets'),
        meta?: map[string]any(name='Meta'),
        type?: string(name='Type', example='Platform'),
      }
    ](name='Monitors'),
  }(name='Config'),
  expiredTime?: string(name='ExpiredTime', example='2022-12-14 00:00:00.0'),
  gmtCreateTime?: string(name='GmtCreateTime', example='2022-10-13 17:34:52.0'),
  gmtModifiedTime?: string(name='GmtModifiedTime', example='2022-11-05 09:02:30.0'),
  instanceId?: string(name='InstanceId', example='pairec-test1'),
  operatingTool?: {
    isEnable?: boolean(name='IsEnable'),
  }(name='OperatingTool'),
  regionId?: string(name='RegionId', example='cn-shenzhen'),
  requestId?: string(name='RequestId', example='728C5E01-ABF6-5AA8-B9FC-B3BA05DECC77'),
  status?: string(name='Status', example='Initializing'),
  type?: string(name='Type', example='basic'),
}

model GetInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetInstanceResponseBody(name='body'),
}

/**
 * @summary 获取指定推荐全链路深度定制开发平台实例信息。
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetInstanceResponse
 */
async function getInstanceWithOptions(InstanceId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetInstanceResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetInstance',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取指定推荐全链路深度定制开发平台实例信息。
 *
 * @return GetInstanceResponse
 */
async function getInstance(InstanceId: string): GetInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getInstanceWithOptions(InstanceId, headers, runtime);
}

model GetInstanceResourceResponseBody = {
  category?: string(name='Category', example='DataManagement'),
  config?: string(name='Config', example='{}'),
  gmtCreateTime?: string(name='GmtCreateTime', example='2020-10-13 17:34:52'),
  gmtModifiedTime?: string(name='GmtModifiedTime', example='2020-10-13 17:34:52'),
  group?: string(name='Group', example='storage'),
  requestId?: string(name='RequestId', example='D75C43DC-3D3A-5CC8-9AAC-8C77306C433B'),
  resourceId?: string(name='ResourceId', example='reso-2s416t***'),
  type?: string(name='Type', example='OSS'),
  uri?: string(name='Uri', example='bucket-test-123'),
}

model GetInstanceResourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetInstanceResourceResponseBody(name='body'),
}

/**
 * @summary 获取指定实例下指定资源的详细信息。
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetInstanceResourceResponse
 */
async function getInstanceResourceWithOptions(InstanceId: string, ResourceId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetInstanceResourceResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetInstanceResource',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/resources/${OpenApiUtil.getEncodeParam(ResourceId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取指定实例下指定资源的详细信息。
 *
 * @return GetInstanceResourceResponse
 */
async function getInstanceResource(InstanceId: string, ResourceId: string): GetInstanceResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getInstanceResourceWithOptions(InstanceId, ResourceId, headers, runtime);
}

model GetInstanceResourceTableResponseBody = {
  fields?: [ 
    {
      isDimensionField?: boolean(name='IsDimensionField', example='false'),
      isPartitionField?: boolean(name='IsPartitionField'),
      meaning?: string(name='Meaning', example='""'),
      name?: string(name='Name', example='age'),
      type?: string(name='Type', example='BIGINT'),
    }
  ](name='Fields'),
  requestId?: string(name='RequestId', example='74D958EF-3598-56FA-8296-FF1575CE43DF'),
  tableName?: string(name='TableName', example='test_table'),
}

model GetInstanceResourceTableResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetInstanceResourceTableResponseBody(name='body'),
}

/**
 * @summary 获取数据源下指定表的详细信息。
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetInstanceResourceTableResponse
 */
async function getInstanceResourceTableWithOptions(InstanceId: string, ResourceId: string, TableName: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetInstanceResourceTableResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetInstanceResourceTable',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/resources/${OpenApiUtil.getEncodeParam(ResourceId)}/tables/${OpenApiUtil.getEncodeParam(TableName)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取数据源下指定表的详细信息。
 *
 * @return GetInstanceResourceTableResponse
 */
async function getInstanceResourceTable(InstanceId: string, ResourceId: string, TableName: string): GetInstanceResourceTableResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getInstanceResourceTableWithOptions(InstanceId, ResourceId, TableName, headers, runtime);
}

model GetLaboratoryRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-test1'),
}

model GetLaboratoryResponseBody = {
  bucketCount?: int32(name='BucketCount', example='100'),
  bucketType?: string(name='BucketType', example='Filter'),
  buckets?: string(name='Buckets', example='1,2,3,10-20'),
  crowdId?: string(name='CrowdId', example='3'),
  debugCrowdId?: string(name='DebugCrowdId', example='3'),
  debugUsers?: string(name='DebugUsers', example='user1,user2,user3'),
  description?: string(name='Description', example='This is a test.'),
  environment?: string(name='Environment', example='Daily'),
  filter?: string(name='Filter', example='filter=xxx'),
  name?: string(name='Name', example='laboratory1'),
  requestId?: string(name='RequestId', description='Id of the request', example='1C0898E5-9220-5443-B2D9-445FF0688215'),
  sceneId?: string(name='SceneId', example='3'),
  status?: string(name='Status', example='Offline'),
  type?: string(name='Type', example='Base'),
}

model GetLaboratoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetLaboratoryResponseBody(name='body'),
}

/**
 * @summary 获取实验室详细信息。
 *
 * @param request GetLaboratoryRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetLaboratoryResponse
 */
async function getLaboratoryWithOptions(LaboratoryId: string, request: GetLaboratoryRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetLaboratoryResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetLaboratory',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/laboratories/${OpenApiUtil.getEncodeParam(LaboratoryId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取实验室详细信息。
 *
 * @param request GetLaboratoryRequest
 * @return GetLaboratoryResponse
 */
async function getLaboratory(LaboratoryId: string, request: GetLaboratoryRequest): GetLaboratoryResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getLaboratoryWithOptions(LaboratoryId, request, headers, runtime);
}

model GetLayerRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-abcdefg1234'),
}

model GetLayerResponseBody = {
  description?: string(name='Description', example='This is a test.'),
  gmtCreateTime?: string(name='GmtCreateTime'),
  laboratoryId?: string(name='LaboratoryId', example='3'),
  name?: string(name='Name', example='layer1'),
  requestId?: string(name='RequestId', description='Id of the request', example='EE97D06A-2AA0-5AD9-B6CF-8A267924D691'),
  residualFlow?: long(name='ResidualFlow'),
  sceneId?: string(name='SceneId', example='4'),
}

model GetLayerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetLayerResponseBody(name='body'),
}

/**
 * @summary 获取层详细信息。
 *
 * @param request GetLayerRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetLayerResponse
 */
async function getLayerWithOptions(LayerId: string, request: GetLayerRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetLayerResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetLayer',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/layers/${OpenApiUtil.getEncodeParam(LayerId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取层详细信息。
 *
 * @param request GetLayerRequest
 * @return GetLayerResponse
 */
async function getLayer(LayerId: string, request: GetLayerRequest): GetLayerResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getLayerWithOptions(LayerId, request, headers, runtime);
}

model GetResourceRuleRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
}

model GetResourceRuleResponseBody = {
  description?: string(name='Description'),
  metricOperationType?: string(name='MetricOperationType'),
  metricPullInfo?: string(name='MetricPullInfo'),
  metricPullPeriod?: string(name='MetricPullPeriod'),
  name?: string(name='Name'),
  requestId?: string(name='RequestId'),
  resourceRuleId?: string(name='ResourceRuleId'),
  ruleComputingDefinition?: string(name='RuleComputingDefinition'),
  ruleItems?: [ 
    {
      description?: string(name='Description'),
      maxValue?: string(name='MaxValue'),
      minValue?: string(name='MinValue'),
      name?: string(name='Name'),
      value?: string(name='Value'),
    }
  ](name='RuleItems'),
}

model GetResourceRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetResourceRuleResponseBody(name='body'),
}

/**
 * @summary 获取资源规则详细信息
 *
 * @param request GetResourceRuleRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetResourceRuleResponse
 */
async function getResourceRuleWithOptions(ResourceRuleId: string, request: GetResourceRuleRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetResourceRuleResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetResourceRule',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/resourcerules/${OpenApiUtil.getEncodeParam(ResourceRuleId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取资源规则详细信息
 *
 * @param request GetResourceRuleRequest
 * @return GetResourceRuleResponse
 */
async function getResourceRule(ResourceRuleId: string, request: GetResourceRuleRequest): GetResourceRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getResourceRuleWithOptions(ResourceRuleId, request, headers, runtime);
}

model GetSceneRequest {
  instanceId?: string(name='InstanceId', example='pairec-cn-abcdefg1234'),
}

model GetSceneResponseBody = {
  description?: string(name='Description', example='This is a test.'),
  flows?: [ 
    {
      flowCode?: string(name='FlowCode', example='liuliang1'),
      flowName?: string(name='FlowName', example='流量1'),
    }
  ](name='Flows'),
  name?: string(name='Name', example='scene1'),
  requestId?: string(name='RequestId', description='Id of the request', example='B8987BF7-6028-5B17-80E0-251B7BD67BBA'),
}

model GetSceneResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSceneResponseBody(name='body'),
}

/**
 * @summary 获取场景详细信息
 *
 * @param request GetSceneRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSceneResponse
 */
async function getSceneWithOptions(SceneId: string, request: GetSceneRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetSceneResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetScene',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/scenes/${OpenApiUtil.getEncodeParam(SceneId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取场景详细信息
 *
 * @param request GetSceneRequest
 * @return GetSceneResponse
 */
async function getScene(SceneId: string, request: GetSceneRequest): GetSceneResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getSceneWithOptions(SceneId, request, headers, runtime);
}

model GetSubCrowdRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-abcdefg1234'),
}

model GetSubCrowdResponseBody = {
  gmtCreateTime?: string(name='GmtCreateTime', example='2021-12-15T23:24:33.132+08:00'),
  quantity?: string(name='Quantity', example='3'),
  requestId?: string(name='RequestId', description='Id of the request', example='01D22D08-BA20-5F35-8302-99115F288220'),
  source?: string(name='Source', example='ManualInput'),
  users?: string(name='Users', example='user1,user2'),
}

model GetSubCrowdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSubCrowdResponseBody(name='body'),
}

/**
 * @summary 获取指定人群下的指定子人群的详细信息。
 *
 * @param request GetSubCrowdRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSubCrowdResponse
 */
async function getSubCrowdWithOptions(CrowdId: string, SubCrowdId: string, request: GetSubCrowdRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetSubCrowdResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetSubCrowd',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/crowds/${OpenApiUtil.getEncodeParam(CrowdId)}/subcrowds/${OpenApiUtil.getEncodeParam(SubCrowdId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取指定人群下的指定子人群的详细信息。
 *
 * @param request GetSubCrowdRequest
 * @return GetSubCrowdResponse
 */
async function getSubCrowd(CrowdId: string, SubCrowdId: string, request: GetSubCrowdRequest): GetSubCrowdResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getSubCrowdWithOptions(CrowdId, SubCrowdId, request, headers, runtime);
}

model GetTableMetaRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
}

model GetTableMetaResponseBody = {
  canDelete?: boolean(name='CanDelete', example='false'),
  config?: string(name='Config'),
  description?: string(name='Description', example='this is a test table'),
  fields?: [ 
    {
      isDimensionField?: boolean(name='IsDimensionField', example='false'),
      meaning?: string(name='Meaning', example='the gender of people'),
      name?: string(name='Name', example='gender'),
      type?: string(name='Type', example='BIGINT'),
    }
  ](name='Fields'),
  gmtCreateTime?: string(name='GmtCreateTime', example='2021-12-15:24:33'),
  gmtImportedTime?: string(name='GmtImportedTime'),
  gmtModifiedTime?: string(name='GmtModifiedTime', example='2021-12-15:24:33'),
  module?: string(name='Module', example='ABTest'),
  name?: string(name='Name', example='test_table'),
  requestId?: string(name='RequestId', example='28C5E01-ABF6-5AA8-B9FC-B3BA05DECC77'),
  resourceId?: string(name='ResourceId', example='reso-wkgo***'),
  tableMetaId?: string(name='TableMetaId'),
  tableName?: string(name='TableName', example='table_mysql'),
  type?: string(name='Type', example='MaxCompute'),
  url?: string(name='Url', example='https://dmc-xxx.com/dm/table/xxx'),
}

model GetTableMetaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTableMetaResponseBody(name='body'),
}

/**
 * @summary 获取数据表详细信息。
 *
 * @param request GetTableMetaRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTableMetaResponse
 */
async function getTableMetaWithOptions(TableMetaId: string, request: GetTableMetaRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetTableMetaResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetTableMeta',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/tablemetas/${OpenApiUtil.getEncodeParam(TableMetaId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取数据表详细信息。
 *
 * @param request GetTableMetaRequest
 * @return GetTableMetaResponse
 */
async function getTableMeta(TableMetaId: string, request: GetTableMetaRequest): GetTableMetaResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getTableMetaWithOptions(TableMetaId, request, headers, runtime);
}

model GetTrafficControlTargetRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
}

model GetTrafficControlTargetResponseBody = {
  endTime?: string(name='EndTime'),
  event?: string(name='Event'),
  gmtCreateTime?: string(name='GmtCreateTime'),
  itemConditionArray?: string(name='ItemConditionArray'),
  itemConditionExpress?: string(name='ItemConditionExpress'),
  itemConditionType?: string(name='ItemConditionType'),
  name?: string(name='Name'),
  newProductRegulation?: boolean(name='NewProductRegulation'),
  recallName?: string(name='RecallName'),
  requestId?: string(name='RequestId'),
  splitParts?: {
    setPoints?: [ long ](name='SetPoints'),
    setValues?: [ long ](name='SetValues'),
    timePoints?: [ long ](name='TimePoints'),
  }(name='SplitParts'),
  startTime?: string(name='StartTime'),
  statisPeriod?: string(name='StatisPeriod'),
  status?: string(name='Status'),
  toleranceValue?: long(name='ToleranceValue'),
  trafficControlTargetId?: string(name='TrafficControlTargetId'),
  value?: float(name='Value'),
}

model GetTrafficControlTargetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTrafficControlTargetResponseBody(name='body'),
}

/**
 * @summary 获取流量调控目标详情
 *
 * @param request GetTrafficControlTargetRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTrafficControlTargetResponse
 */
async function getTrafficControlTargetWithOptions(TrafficControlTargetId: string, request: GetTrafficControlTargetRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetTrafficControlTargetResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetTrafficControlTarget',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/trafficcontroltargets/${OpenApiUtil.getEncodeParam(TrafficControlTargetId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取流量调控目标详情
 *
 * @param request GetTrafficControlTargetRequest
 * @return GetTrafficControlTargetResponse
 */
async function getTrafficControlTarget(TrafficControlTargetId: string, request: GetTrafficControlTargetRequest): GetTrafficControlTargetResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getTrafficControlTargetWithOptions(TrafficControlTargetId, request, headers, runtime);
}

model GetTrafficControlTaskRequest {
  controlTargetFilter?: string(name='ControlTargetFilter'),
  environment?: string(name='Environment'),
  instanceId?: string(name='InstanceId'),
  regionId?: string(name='RegionId'),
  version?: string(name='Version'),
}

model GetTrafficControlTaskResponseBody = {
  behaviorTableMetaId?: string(name='BehaviorTableMetaId'),
  controlGranularity?: string(name='ControlGranularity'),
  controlLogic?: string(name='ControlLogic'),
  controlType?: string(name='ControlType'),
  description?: string(name='Description'),
  endTime?: string(name='EndTime'),
  everPublished?: boolean(name='EverPublished'),
  executionTime?: string(name='ExecutionTime'),
  gmtCreateTime?: string(name='GmtCreateTime'),
  gmtModifiedTime?: string(name='GmtModifiedTime'),
  itemConditionArray?: string(name='ItemConditionArray'),
  itemConditionExpress?: string(name='ItemConditionExpress'),
  itemConditionType?: string(name='ItemConditionType'),
  itemTableMetaId?: string(name='ItemTableMetaId'),
  name?: string(name='Name'),
  preExperimentIds?: string(name='PreExperimentIds'),
  prepubStatus?: string(name='PrepubStatus'),
  prodExperimentIds?: string(name='ProdExperimentIds'),
  productStatus?: string(name='ProductStatus'),
  requestId?: string(name='RequestId'),
  sceneId?: string(name='SceneId'),
  sceneName?: string(name='SceneName'),
  serviceId?: string(name='ServiceId'),
  startTime?: string(name='StartTime'),
  statisBehaviorConditionArray?: string(name='StatisBehaviorConditionArray'),
  statisBehaviorConditionExpress?: string(name='StatisBehaviorConditionExpress'),
  statisBehaviorConditionType?: string(name='StatisBehaviorConditionType'),
  trafficControlTargets?: [ 
    {
      endTime?: string(name='EndTime'),
      event?: string(name='Event'),
      gmtCreateTime?: string(name='GmtCreateTime'),
      gmtModifiedTime?: string(name='GmtModifiedTime'),
      itemConditionArray?: string(name='ItemConditionArray'),
      itemConditionExpress?: string(name='ItemConditionExpress'),
      itemConditionType?: string(name='ItemConditionType'),
      name?: string(name='Name'),
      newProductRegulation?: boolean(name='NewProductRegulation'),
      recallName?: string(name='RecallName'),
      splitParts?: {
        setPoints?: [ int32 ](name='SetPoints'),
        setValues?: [ long ](name='SetValues'),
        timePoints?: [ int32 ](name='TimePoints'),
      }(name='SplitParts'),
      startTime?: string(name='StartTime'),
      statisPeriod?: string(name='StatisPeriod'),
      status?: string(name='Status'),
      toleranceValue?: long(name='ToleranceValue'),
      trafficControlTargetId?: string(name='TrafficControlTargetId'),
      value?: float(name='Value'),
    }
  ](name='TrafficControlTargets'),
  trafficControlTaskId?: string(name='TrafficControlTaskId'),
  userConditionArray?: string(name='UserConditionArray'),
  userConditionExpress?: string(name='UserConditionExpress'),
  userConditionType?: string(name='UserConditionType'),
  userTableMetaId?: string(name='UserTableMetaId'),
}

model GetTrafficControlTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTrafficControlTaskResponseBody(name='body'),
}

/**
 * @summary 获取流量调控任务详情
 *
 * @param request GetTrafficControlTaskRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTrafficControlTaskResponse
 */
async function getTrafficControlTaskWithOptions(TrafficControlTaskId: string, request: GetTrafficControlTaskRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetTrafficControlTaskResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.controlTargetFilter)) {
    query['ControlTargetFilter'] = request.controlTargetFilter;
  }
  if (!Util.isUnset(request.environment)) {
    query['Environment'] = request.environment;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.version)) {
    query['Version'] = request.version;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetTrafficControlTask',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/trafficcontroltasks/${OpenApiUtil.getEncodeParam(TrafficControlTaskId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取流量调控任务详情
 *
 * @param request GetTrafficControlTaskRequest
 * @return GetTrafficControlTaskResponse
 */
async function getTrafficControlTask(TrafficControlTaskId: string, request: GetTrafficControlTaskRequest): GetTrafficControlTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getTrafficControlTaskWithOptions(TrafficControlTaskId, request, headers, runtime);
}

model GetTrafficControlTaskTrafficRequest {
  environment?: string(name='Environment'),
  instanceId?: string(name='InstanceId'),
}

model GetTrafficControlTaskTrafficResponseBody = {
  requestId?: string(name='RequestId'),
  trafficControlTaskTrafficInfo?: {
    targetTraffics?: [ 
      {
        data?: map[string]TrafficControlTaskTrafficInfoTargetTrafficsDataValue(name='Data'),
        trafficContorlTargetId?: string(name='TrafficContorlTargetId'),
      }
    ](name='TargetTraffics'),
    taskTraffics?: map[string]TrafficControlTaskTrafficInfoTaskTrafficsValue(name='TaskTraffics'),
  }(name='TrafficControlTaskTrafficInfo'),
}

model GetTrafficControlTaskTrafficResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTrafficControlTaskTrafficResponseBody(name='body'),
}

/**
 * @summary 获取流量调控任务的流量详情
 *
 * @param request GetTrafficControlTaskTrafficRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTrafficControlTaskTrafficResponse
 */
async function getTrafficControlTaskTrafficWithOptions(TrafficControlTaskId: string, request: GetTrafficControlTaskTrafficRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetTrafficControlTaskTrafficResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.environment)) {
    query['Environment'] = request.environment;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetTrafficControlTaskTraffic',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/trafficcontroltasks/${OpenApiUtil.getEncodeParam(TrafficControlTaskId)}/trafficinfo`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取流量调控任务的流量详情
 *
 * @param request GetTrafficControlTaskTrafficRequest
 * @return GetTrafficControlTaskTrafficResponse
 */
async function getTrafficControlTaskTraffic(TrafficControlTaskId: string, request: GetTrafficControlTaskTrafficRequest): GetTrafficControlTaskTrafficResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getTrafficControlTaskTrafficWithOptions(TrafficControlTaskId, request, headers, runtime);
}

model ListABMetricGroupsRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-test1'),
  order?: string(name='Order'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  realtime?: boolean(name='Realtime', example='false'),
  sceneId?: string(name='SceneId', example='1'),
  sortBy?: string(name='SortBy'),
}

model ListABMetricGroupsResponseBody = {
  ABMetricGroups?: [ 
    {
      ABMetricGroupId?: string(name='ABMetricGroupId', example='1'),
      ABMetricIds?: string(name='ABMetricIds', example='1,2'),
      ABMetricNames?: string(name='ABMetricNames', example='pv,uv'),
      description?: string(name='Description'),
      name?: string(name='Name', example='visits'),
      owner?: string(name='Owner', example='2799614***'),
      realtime?: boolean(name='Realtime', example='false'),
      sceneId?: string(name='SceneId', example='1'),
    }
  ](name='ABMetricGroups'),
  requestId?: string(name='RequestId', example='E15A1443-7917-5BE0-AE70-25538ECF398D'),
  totalCount?: long(name='TotalCount', example='10'),
}

model ListABMetricGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListABMetricGroupsResponseBody(name='body'),
}

/**
 * @summary 获取AB Test实验指标组列表。
 *
 * @param request ListABMetricGroupsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListABMetricGroupsResponse
 */
async function listABMetricGroupsWithOptions(request: ListABMetricGroupsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListABMetricGroupsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.realtime)) {
    query['Realtime'] = request.realtime;
  }
  if (!Util.isUnset(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }
  if (!Util.isUnset(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListABMetricGroups',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/abmetricgroups`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取AB Test实验指标组列表。
 *
 * @param request ListABMetricGroupsRequest
 * @return ListABMetricGroupsResponse
 */
async function listABMetricGroups(request: ListABMetricGroupsRequest): ListABMetricGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listABMetricGroupsWithOptions(request, headers, runtime);
}

model ListABMetricsRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-test1'),
  name?: string(name='Name', example='home'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  realtime?: boolean(name='Realtime', example='false'),
  sceneId?: string(name='SceneId', example='1'),
  tableMetaId?: string(name='TableMetaId', example='1'),
  type?: string(name='Type', example='Single'),
}

model ListABMetricsResponseBody = {
  ABMetrics?: [ 
    {
      ABMetricId?: string(name='ABMetricId', example='1'),
      definition?: string(name='Definition', example='sum(click_cnt)'),
      description?: string(name='Description'),
      leftMetricId?: string(name='LeftMetricId', example='3'),
      name?: string(name='Name', example='pv'),
      operator?: string(name='Operator', example='Division'),
      realtime?: string(name='Realtime', example='false'),
      resultResourceId?: string(name='ResultResourceId', example='3'),
      resultTableMetaId?: string(name='ResultTableMetaId', example='2'),
      rightMetricId?: string(name='RightMetricId', example='2'),
      sceneId?: string(name='SceneId', example='1'),
      sceneName?: string(name='SceneName', example='home_feed'),
      statisticsCycle?: int32(name='StatisticsCycle', example='1'),
      tableMetaId?: string(name='TableMetaId', example='1'),
      type?: string(name='Type', example='Single'),
    }
  ](name='ABMetrics'),
  requestId?: string(name='RequestId', example='F7AC05FF-EDE7-5C2B-B9AE-33D6DF4178BA'),
  totalCount?: long(name='TotalCount', example='10'),
}

model ListABMetricsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListABMetricsResponseBody(name='body'),
}

/**
 * @summary 获取AB Test实验指标列表。
 *
 * @param request ListABMetricsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListABMetricsResponse
 */
async function listABMetricsWithOptions(request: ListABMetricsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListABMetricsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.realtime)) {
    query['Realtime'] = request.realtime;
  }
  if (!Util.isUnset(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }
  if (!Util.isUnset(request.tableMetaId)) {
    query['TableMetaId'] = request.tableMetaId;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListABMetrics',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/abmetrics`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取AB Test实验指标列表。
 *
 * @param request ListABMetricsRequest
 * @return ListABMetricsResponse
 */
async function listABMetrics(request: ListABMetricsRequest): ListABMetricsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listABMetricsWithOptions(request, headers, runtime);
}

model ListCalculationJobsRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-test1'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  sceneId?: string(name='SceneId', description='This parameter is required.', example='1'),
  status?: string(name='Status', example='Success'),
}

model ListCalculationJobsResponseBody = {
  calculationJobs?: [ 
    {
      ABMetricName?: string(name='ABMetricName', example='pv'),
      bizDate?: string(name='BizDate', example='2021-12-15'),
      calculationJobId?: string(name='CalculationJobId', example='2'),
      config?: string(name='Config', example='{}'),
      gmtRanTime?: string(name='GmtRanTime', example='2021-12-15T23:24:33.132+08:00'),
      jobMessage?: [ string ](name='JobMessage'),
      jobSource?: string(name='JobSource', example='CronOffline'),
      status?: string(name='Status', example='Success'),
    }
  ](name='CalculationJobs'),
  requestId?: string(name='RequestId', example='F7AC05FF-EDE7-5C2B-B9AE-33D6DF4178BA'),
  totalCount?: long(name='TotalCount', example='10'),
}

model ListCalculationJobsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCalculationJobsResponseBody(name='body'),
}

/**
 * @summary 获取计算任务列表。
 *
 * @param request ListCalculationJobsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCalculationJobsResponse
 */
async function listCalculationJobsWithOptions(request: ListCalculationJobsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListCalculationJobsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListCalculationJobs',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/calculationjobs`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取计算任务列表。
 *
 * @param request ListCalculationJobsRequest
 * @return ListCalculationJobsResponse
 */
async function listCalculationJobs(request: ListCalculationJobsRequest): ListCalculationJobsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listCalculationJobsWithOptions(request, headers, runtime);
}

model ListCrowdUsersRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-abcdefg1234'),
}

model ListCrowdUsersResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request', example='F0AB6527-093F-5C44-B3BD-42C8C210C619'),
  totalCount?: long(name='TotalCount', example='3'),
  users?: [ string ](name='Users'),
}

model ListCrowdUsersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCrowdUsersResponseBody(name='body'),
}

/**
 * @summary 获取人群下的所有用户。
 *
 * @param request ListCrowdUsersRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCrowdUsersResponse
 */
async function listCrowdUsersWithOptions(CrowdId: string, request: ListCrowdUsersRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListCrowdUsersResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListCrowdUsers',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/crowds/${OpenApiUtil.getEncodeParam(CrowdId)}/users`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取人群下的所有用户。
 *
 * @param request ListCrowdUsersRequest
 * @return ListCrowdUsersResponse
 */
async function listCrowdUsers(CrowdId: string, request: ListCrowdUsersRequest): ListCrowdUsersResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listCrowdUsersWithOptions(CrowdId, request, headers, runtime);
}

model ListCrowdsRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-abcdefg1234'),
}

model ListCrowdsResponseBody = {
  crowds?: [ 
    {
      crowdId?: string(name='CrowdId', example='3'),
      description?: string(name='Description', example='This is a test.'),
      gmtCreateTime?: string(name='GmtCreateTime', example='2021-12-15T23:24:33.132+08:00'),
      label?: string(name='Label', example='os=android'),
      name?: string(name='Name', example='crowd1'),
      quantity?: string(name='Quantity', example='10'),
      source?: string(name='Source', example='ManualInput'),
      users?: string(name='Users', example='user1,user2'),
    }
  ](name='Crowds'),
  requestId?: string(name='RequestId', description='Id of the request', example='9763624B-5FBB-5E3A-9193-B1ADB554CEAE'),
  totalCount?: long(name='TotalCount', example='10'),
}

model ListCrowdsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListCrowdsResponseBody(name='body'),
}

/**
 * @summary 获取人群列表。
 *
 * @param request ListCrowdsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListCrowdsResponse
 */
async function listCrowdsWithOptions(request: ListCrowdsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListCrowdsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListCrowds',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/crowds`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取人群列表。
 *
 * @param request ListCrowdsRequest
 * @return ListCrowdsResponse
 */
async function listCrowds(request: ListCrowdsRequest): ListCrowdsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listCrowdsWithOptions(request, headers, runtime);
}

model ListEngineConfigsRequest {
  environment?: string(name='Environment', example='Pre'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-***test'),
  name?: string(name='Name', example='engine_config_v1'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  status?: string(name='Status', example='Released'),
  version?: string(name='Version', example='latest'),
}

model ListEngineConfigsResponseBody = {
  engineConfigs?: [ 
    {
      configValue?: string(name='ConfigValue', example='{}'),
      description?: string(name='Description'),
      engineConfigId?: string(name='EngineConfigId', example='2'),
      environment?: string(name='Environment', example='Pre'),
      gmtCreateTime?: string(name='GmtCreateTime', example='2023-08-07T01:43:42Z'),
      gmtModifiedTime?: string(name='GmtModifiedTime', example='2023-08-27T12:00:00Z'),
      gmtReleasedTime?: string(name='GmtReleasedTime', example='2023-08-29 12:00:00'),
      name?: string(name='Name', example='engine_config_v1'),
      status?: string(name='Status', example='Released'),
      version?: string(name='Version', example='20230509161300'),
    }
  ](name='EngineConfigs'),
  requestId?: string(name='RequestId', example='74D958EF-3598-56FA-8296-FF1575CE43DF'),
  totalCount?: long(name='TotalCount', example='10'),
}

model ListEngineConfigsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListEngineConfigsResponseBody(name='body'),
}

/**
 * @summary 获取引擎配置列表。
 *
 * @param request ListEngineConfigsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListEngineConfigsResponse
 */
async function listEngineConfigsWithOptions(request: ListEngineConfigsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListEngineConfigsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.environment)) {
    query['Environment'] = request.environment;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.version)) {
    query['Version'] = request.version;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListEngineConfigs',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/engineconfigs`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取引擎配置列表。
 *
 * @param request ListEngineConfigsRequest
 * @return ListEngineConfigsResponse
 */
async function listEngineConfigs(request: ListEngineConfigsRequest): ListEngineConfigsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listEngineConfigsWithOptions(request, headers, runtime);
}

model ListExperimentGroupsRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-abcdefg1234'),
  layerId?: string(name='LayerId', example='3'),
  regionId?: string(name='RegionId'),
  status?: string(name='Status', example='Online'),
  timeRangeEnd?: string(name='TimeRangeEnd'),
  timeRangeStart?: string(name='TimeRangeStart'),
}

model ListExperimentGroupsResponseBody = {
  experimentGroups?: [ 
    {
      config?: string(name='Config', example='{}'),
      crowdId?: string(name='CrowdId', example='3'),
      crowdTargetType?: string(name='CrowdTargetType'),
      debugCrowdId?: string(name='DebugCrowdId', example='4'),
      debugUsers?: string(name='DebugUsers', example='1124512470******,1124512471******,1124512472******'),
      description?: string(name='Description', example='This is a test.'),
      distributionTimeDuration?: int32(name='DistributionTimeDuration', example='5'),
      distributionType?: string(name='DistributionType', example='UserId'),
      experimentGroupId?: string(name='ExperimentGroupId', example='3'),
      filter?: string(name='Filter', example='gender=female'),
      holdingBuckets?: string(name='HoldingBuckets'),
      laboratoryId?: string(name='LaboratoryId', example='4'),
      layerId?: string(name='LayerId', example='3'),
      name?: string(name='Name', example='experiment_group1'),
      needAA?: boolean(name='NeedAA', example='true'),
      owner?: string(name='Owner', example='1124512470******'),
      randomFlow?: long(name='RandomFlow'),
      reservedBuckets?: string(name='ReservedBuckets', example='1,2,3,4'),
      sceneId?: string(name='SceneId', example='1'),
      status?: string(name='Status', example='Offline'),
    }
  ](name='ExperimentGroups'),
  requestId?: string(name='RequestId', description='Id of the request', example='59CE7EC6-F268-5D71-9215-32922CC50D72'),
  totalCount?: long(name='TotalCount', example='10'),
}

model ListExperimentGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListExperimentGroupsResponseBody(name='body'),
}

/**
 * @summary 获取实验组列表。
 *
 * @param request ListExperimentGroupsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListExperimentGroupsResponse
 */
async function listExperimentGroupsWithOptions(request: ListExperimentGroupsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListExperimentGroupsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.layerId)) {
    query['LayerId'] = request.layerId;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.timeRangeEnd)) {
    query['TimeRangeEnd'] = request.timeRangeEnd;
  }
  if (!Util.isUnset(request.timeRangeStart)) {
    query['TimeRangeStart'] = request.timeRangeStart;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListExperimentGroups',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/experimentgroups`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取实验组列表。
 *
 * @param request ListExperimentGroupsRequest
 * @return ListExperimentGroupsResponse
 */
async function listExperimentGroups(request: ListExperimentGroupsRequest): ListExperimentGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listExperimentGroupsWithOptions(request, headers, runtime);
}

model ListExperimentsRequest {
  experimentGroupId?: string(name='ExperimentGroupId', example='3'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-test1'),
  query?: string(name='Query', example='experiment_test1'),
  status?: string(name='Status', example='Offline'),
}

model ListExperimentsResponseBody = {
  experiments?: [ 
    {
      aliasExperimentId?: string(name='AliasExperimentId', example='L1#EG1#E1'),
      buckets?: string(name='Buckets', example='1,2,3'),
      config?: string(name='Config', example='{}'),
      debugCrowdId?: string(name='DebugCrowdId', example='3'),
      debugUsers?: string(name='DebugUsers', example='uid1,uid2,uid3'),
      description?: string(name='Description', example='This is a test.'),
      experimentGroupId?: string(name='ExperimentGroupId', example='3'),
      experimentId?: string(name='ExperimentId', example='3'),
      flowPercent?: int32(name='FlowPercent', example='100'),
      gmtCreateTime?: string(name='GmtCreateTime', example='2021-12-15T23:24:33.132+08:00'),
      gmtModifiedTime?: string(name='GmtModifiedTime', example='2021-12-15T23:24:33.132+08:00'),
      laboratoryId?: string(name='LaboratoryId', example='3'),
      layerId?: string(name='LayerId', example='3'),
      name?: string(name='Name', example='experiment_test1'),
      sceneId?: string(name='SceneId', example='3'),
      status?: string(name='Status', example='Offline'),
      type?: string(name='Type', example='Baseline'),
    }
  ](name='Experiments'),
  requestId?: string(name='RequestId', description='Id of the request', example='68075085-1A7D-55C2-B51D-7AD9B02A6DD6'),
  totalCount?: long(name='TotalCount', example='10'),
}

model ListExperimentsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListExperimentsResponseBody(name='body'),
}

/**
 * @summary 获取实验列表。
 *
 * @param request ListExperimentsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListExperimentsResponse
 */
async function listExperimentsWithOptions(request: ListExperimentsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListExperimentsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.experimentGroupId)) {
    query['ExperimentGroupId'] = request.experimentGroupId;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.query)) {
    query['Query'] = request.query;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListExperiments',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/experiments`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取实验列表。
 *
 * @param request ListExperimentsRequest
 * @return ListExperimentsResponse
 */
async function listExperiments(request: ListExperimentsRequest): ListExperimentsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listExperimentsWithOptions(request, headers, runtime);
}

model ListFeatureConsistencyCheckJobConfigsRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-********'),
  order?: string(name='Order', example='ASC'),
  pageNumber?: string(name='PageNumber', example='1'),
  pageSize?: string(name='PageSize', example='10'),
  sortBy?: string(name='SortBy', example='GmtCreateTime'),
}

model ListFeatureConsistencyCheckJobConfigsResponseBody = {
  featureConsistencyCheckConfigs?: [ 
    {
      compareFeature?: boolean(name='CompareFeature', example='true'),
      datasetId?: string(name='DatasetId'),
      datasetMountPath?: string(name='DatasetMountPath'),
      datasetName?: string(name='DatasetName'),
      datasetType?: string(name='DatasetType'),
      datasetUri?: string(name='DatasetUri'),
      defaultRoute?: string(name='DefaultRoute'),
      easServiceName?: string(name='EasServiceName', example='eas_service_1'),
      easyRecPackagePath?: string(name='EasyRecPackagePath', example='oss://*******'),
      easyRecVersion?: string(name='EasyRecVersion', example='1.3.60'),
      featureConsistencyCheckJobConfigId?: string(name='FeatureConsistencyCheckJobConfigId', example='3'),
      featureDisplayExclude?: string(name='FeatureDisplayExclude', example='feature1,feature2'),
      featureLandingResourceId?: string(name='FeatureLandingResourceId', example='reso-********'),
      featureLandingResourceUri?: string(name='FeatureLandingResourceUri', example='mc_project_1'),
      featurePriority?: string(name='FeaturePriority', example='feature1,feature2,feature3'),
      featureStoreItemId?: string(name='FeatureStoreItemId'),
      featureStoreModelId?: string(name='FeatureStoreModelId'),
      featureStoreProjectId?: string(name='FeatureStoreProjectId'),
      featureStoreProjectName?: string(name='FeatureStoreProjectName'),
      featureStoreSeqFeatureView?: string(name='FeatureStoreSeqFeatureView'),
      featureStoreUserId?: string(name='FeatureStoreUserId'),
      fgJarVersion?: string(name='FgJarVersion', example='1.0.0'),
      fgJsonFileName?: string(name='FgJsonFileName', example='file.json'),
      generateZip?: boolean(name='GenerateZip', example='true'),
      gmtCreateTime?: string(name='GmtCreateTime', example='2021-12-15T23:24:33.132+08:00'),
      gmtModifiedTime?: string(name='GmtModifiedTime', example='2021-12-15T23:24:33.132+08:00'),
      itemIdField?: string(name='ItemIdField', example='item_id'),
      itemTable?: string(name='ItemTable', example='item_table'),
      itemTablePartitionField?: string(name='ItemTablePartitionField', example='ds'),
      itemTablePartitionFieldFormat?: string(name='ItemTablePartitionFieldFormat', example='yyyymmdd'),
      latestJobGmtSamplingEndTime?: string(name='LatestJobGmtSamplingEndTime', example='2021-12-15T23:24:33.132+08:00'),
      latestJobGmtSamplingStartTime?: string(name='LatestJobGmtSamplingStartTime', example='2021-12-15T23:24:33.132+08:00'),
      latestJobId?: string(name='LatestJobId', example='3'),
      name?: string(name='Name', example='feature_consistency_check1'),
      ossBucket?: string(name='OssBucket', example='oss_bucket_1'),
      ossResourceId?: string(name='OssResourceId', example='reso-********'),
      predictWorkerCount?: int32(name='PredictWorkerCount'),
      predictWorkerCpu?: int32(name='PredictWorkerCpu'),
      predictWorkerMemory?: int32(name='PredictWorkerMemory'),
      sampleRate?: string(name='SampleRate', example='0.89'),
      sceneId?: string(name='SceneId', example='3'),
      sceneName?: string(name='SceneName', example='scene1'),
      securityGroupId?: string(name='SecurityGroupId'),
      serviceId?: string(name='ServiceId', example='4'),
      serviceName?: string(name='ServiceName', example='service1'),
      status?: string(name='Status', example='Editable'),
      switchId?: string(name='SwitchId'),
      useFeatureStore?: string(name='UseFeatureStore'),
      userIdField?: string(name='UserIdField', example='user_id'),
      userTable?: string(name='UserTable', example='user_table'),
      userTablePartitionField?: string(name='UserTablePartitionField', example='ds'),
      userTablePartitionFieldFormat?: string(name='UserTablePartitionFieldFormat', example='yyyymmdd'),
      vpcId?: string(name='VpcId'),
      workflowName?: string(name='WorkflowName', example='work_flow_1'),
      workspaceId?: string(name='WorkspaceId'),
    }
  ](name='FeatureConsistencyCheckConfigs'),
  requestId?: string(name='RequestId', example='FCF741D8-9C30-578E-807F-B935487DB34A'),
  totalCount?: long(name='TotalCount', example='10'),
}

model ListFeatureConsistencyCheckJobConfigsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListFeatureConsistencyCheckJobConfigsResponseBody(name='body'),
}

/**
 * @summary 获取特征一致性检查配置列表。
 *
 * @param request ListFeatureConsistencyCheckJobConfigsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListFeatureConsistencyCheckJobConfigsResponse
 */
async function listFeatureConsistencyCheckJobConfigsWithOptions(request: ListFeatureConsistencyCheckJobConfigsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListFeatureConsistencyCheckJobConfigsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListFeatureConsistencyCheckJobConfigs',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/featureconsistencycheck/jobconfigs`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取特征一致性检查配置列表。
 *
 * @param request ListFeatureConsistencyCheckJobConfigsRequest
 * @return ListFeatureConsistencyCheckJobConfigsResponse
 */
async function listFeatureConsistencyCheckJobConfigs(request: ListFeatureConsistencyCheckJobConfigsRequest): ListFeatureConsistencyCheckJobConfigsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listFeatureConsistencyCheckJobConfigsWithOptions(request, headers, runtime);
}

model ListFeatureConsistencyCheckJobFeatureReportsRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-********'),
  logItemId?: string(name='LogItemId', description='This parameter is required.', example='9010'),
  logRequestId?: string(name='LogRequestId', description='This parameter is required.', example='F7AC05FF-EDE7-5C2B-B9AE-33D6DF4178BA'),
  logUserId?: string(name='LogUserId', description='This parameter is required.', example='1010'),
}

model ListFeatureConsistencyCheckJobFeatureReportsResponseBody = {
  dataPath?: string(name='DataPath', example='https://********'),
  ossPath?: string(name='OssPath', example='oss://********'),
  reportsOfFeatureDiff?: [ 
    {
      featureName?: string(name='FeatureName', example='gender'),
      logItemId?: string(name='LogItemId', example='9010'),
      logRequestId?: string(name='LogRequestId', example='F7AC05FF-EDE7-5C2B-B9AE-33D6DF4178BA'),
      logUserId?: string(name='LogUserId', example='1010'),
      offlineValue?: string(name='OfflineValue', example='male'),
      onlineValue?: string(name='OnlineValue', example='male'),
    }
  ](name='ReportsOfFeatureDiff'),
  requestId?: string(name='RequestId', example='BBD41FBF-E75C-551A-92FA-CAD654AA006F'),
}

model ListFeatureConsistencyCheckJobFeatureReportsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListFeatureConsistencyCheckJobFeatureReportsResponseBody(name='body'),
}

/**
 * @summary 获取特征一致性检查任务的特征报表/比对结果。
 *
 * @param request ListFeatureConsistencyCheckJobFeatureReportsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListFeatureConsistencyCheckJobFeatureReportsResponse
 */
async function listFeatureConsistencyCheckJobFeatureReportsWithOptions(FeatureConsistencyCheckJobId: string, request: ListFeatureConsistencyCheckJobFeatureReportsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListFeatureConsistencyCheckJobFeatureReportsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.logItemId)) {
    query['LogItemId'] = request.logItemId;
  }
  if (!Util.isUnset(request.logRequestId)) {
    query['LogRequestId'] = request.logRequestId;
  }
  if (!Util.isUnset(request.logUserId)) {
    query['LogUserId'] = request.logUserId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListFeatureConsistencyCheckJobFeatureReports',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/featureconsistencycheck/jobs/${OpenApiUtil.getEncodeParam(FeatureConsistencyCheckJobId)}/featurereports`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取特征一致性检查任务的特征报表/比对结果。
 *
 * @param request ListFeatureConsistencyCheckJobFeatureReportsRequest
 * @return ListFeatureConsistencyCheckJobFeatureReportsResponse
 */
async function listFeatureConsistencyCheckJobFeatureReports(FeatureConsistencyCheckJobId: string, request: ListFeatureConsistencyCheckJobFeatureReportsRequest): ListFeatureConsistencyCheckJobFeatureReportsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listFeatureConsistencyCheckJobFeatureReportsWithOptions(FeatureConsistencyCheckJobId, request, headers, runtime);
}

model ListFeatureConsistencyCheckJobScoreReportsRequest {
  excludeRequestIds?: [ string ](name='ExcludeRequestIds'),
  instanceId?: string(name='InstanceId', example='pairec-cn-********'),
}

model ListFeatureConsistencyCheckJobScoreReportsShrinkRequest {
  excludeRequestIdsShrink?: string(name='ExcludeRequestIds'),
  instanceId?: string(name='InstanceId', example='pairec-cn-********'),
}

model ListFeatureConsistencyCheckJobScoreReportsResponseBody = {
  dataPath?: string(name='DataPath', example='http://*******'),
  ossPath?: string(name='OssPath', example='oss://********'),
  reportsOfScoreDiff?: [ 
    {
      logItemId?: string(name='LogItemId', example='4'),
      logRequestId?: string(name='LogRequestId', example='323'),
      logUserId?: string(name='LogUserId', example='3'),
      scoreDiff?: string(name='ScoreDiff', example='0.00000234'),
      scoreDiffDetail?: string(name='ScoreDiffDetail', example='{}'),
    }
  ](name='ReportsOfScoreDiff'),
  requestId?: string(name='RequestId', example='F0AB6527-093F-5C44-B3BD-42C8C210C619'),
}

model ListFeatureConsistencyCheckJobScoreReportsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListFeatureConsistencyCheckJobScoreReportsResponseBody(name='body'),
}

/**
 * @summary 获取特征一致性检查任务分数报表/比对结果。
 *
 * @param tmpReq ListFeatureConsistencyCheckJobScoreReportsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListFeatureConsistencyCheckJobScoreReportsResponse
 */
async function listFeatureConsistencyCheckJobScoreReportsWithOptions(FeatureConsistencyCheckJobId: string, tmpReq: ListFeatureConsistencyCheckJobScoreReportsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListFeatureConsistencyCheckJobScoreReportsResponse {
  Util.validateModel(tmpReq);
  var request = new ListFeatureConsistencyCheckJobScoreReportsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.excludeRequestIds)) {
    request.excludeRequestIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.excludeRequestIds, 'ExcludeRequestIds', 'json');
  }
  var query : map[string]any = {};
  if (!Util.isUnset(request.excludeRequestIdsShrink)) {
    query['ExcludeRequestIds'] = request.excludeRequestIdsShrink;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListFeatureConsistencyCheckJobScoreReports',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/featureconsistencycheck/jobs/${OpenApiUtil.getEncodeParam(FeatureConsistencyCheckJobId)}/scorereports`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取特征一致性检查任务分数报表/比对结果。
 *
 * @param request ListFeatureConsistencyCheckJobScoreReportsRequest
 * @return ListFeatureConsistencyCheckJobScoreReportsResponse
 */
async function listFeatureConsistencyCheckJobScoreReports(FeatureConsistencyCheckJobId: string, request: ListFeatureConsistencyCheckJobScoreReportsRequest): ListFeatureConsistencyCheckJobScoreReportsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listFeatureConsistencyCheckJobScoreReportsWithOptions(FeatureConsistencyCheckJobId, request, headers, runtime);
}

model ListFeatureConsistencyCheckJobsRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-********'),
  order?: string(name='Order', example='ASC'),
  pageNumber?: string(name='PageNumber', example='1'),
  pageSize?: string(name='PageSize', example='10'),
  sortBy?: string(name='SortBy', example='GmtCreateTime'),
  status?: string(name='Status', example='Running'),
}

model ListFeatureConsistencyCheckJobsResponseBody = {
  featureConsistencyCheckJobs?: [ 
    {
      config?: string(name='Config', example='{}'),
      featureConsistencyCheckJobConfigId?: string(name='FeatureConsistencyCheckJobConfigId', example='5'),
      featureConsistencyCheckJobConfigName?: string(name='FeatureConsistencyCheckJobConfigName', example='feature_consistency_check_1'),
      featureConsistencyCheckJobId?: string(name='FeatureConsistencyCheckJobId', example='4'),
      gmtEndTime?: string(name='GmtEndTime', example='2021-12-15T23:24:33.132+08:00'),
      gmtStartTime?: string(name='GmtStartTime', example='2021-12-15T23:24:33.132+08:00'),
      logs?: [ string ](name='Logs'),
      status?: string(name='Status', example='Running'),
    }
  ](name='FeatureConsistencyCheckJobs'),
  requestId?: string(name='RequestId', example='A04CB8C0-E74A-5E83-BC61-64D153574EC7'),
  totalCount?: string(name='TotalCount', example='10'),
}

model ListFeatureConsistencyCheckJobsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListFeatureConsistencyCheckJobsResponseBody(name='body'),
}

/**
 * @summary 获取特征一致性检查任务列表。
 *
 * @param request ListFeatureConsistencyCheckJobsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListFeatureConsistencyCheckJobsResponse
 */
async function listFeatureConsistencyCheckJobsWithOptions(request: ListFeatureConsistencyCheckJobsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListFeatureConsistencyCheckJobsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListFeatureConsistencyCheckJobs',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/featureconsistencycheck/jobs`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取特征一致性检查任务列表。
 *
 * @param request ListFeatureConsistencyCheckJobsRequest
 * @return ListFeatureConsistencyCheckJobsResponse
 */
async function listFeatureConsistencyCheckJobs(request: ListFeatureConsistencyCheckJobsRequest): ListFeatureConsistencyCheckJobsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listFeatureConsistencyCheckJobsWithOptions(request, headers, runtime);
}

model ListInstanceResourcesRequest {
  category?: string(name='Category', example='DataManagement'),
  group?: string(name='Group', example='storage'),
  type?: string(name='Type', example='OSS'),
}

model ListInstanceResourcesResponseBody = {
  requestId?: string(name='RequestId', example='9763624B-5FBB-5E3A-9193-B1ADB554CEAE'),
  resources?: [ 
    {
      category?: string(name='Category', example='DataManagement'),
      config?: string(name='Config', example='{}'),
      gmtCreateAt?: string(name='GmtCreateAt', example='2020-10-13 17:34:52'),
      gmtModifiedAt?: string(name='GmtModifiedAt', example='2020-10-13 17:34:52'),
      group?: string(name='Group', example='storage'),
      resourceId?: string(name='ResourceId', example='reso-2s416t***'),
      type?: string(name='Type', example='OSS'),
      uri?: string(name='Uri', example='bucket-test-123'),
    }
  ](name='Resources'),
  totalCount?: long(name='TotalCount', example='10'),
}

model ListInstanceResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListInstanceResourcesResponseBody(name='body'),
}

/**
 * @summary 获取实例下配置的资源列表。
 *
 * @param request ListInstanceResourcesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListInstanceResourcesResponse
 */
async function listInstanceResourcesWithOptions(InstanceId: string, request: ListInstanceResourcesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListInstanceResourcesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.category)) {
    query['Category'] = request.category;
  }
  if (!Util.isUnset(request.group)) {
    query['Group'] = request.group;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListInstanceResources',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/resources`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取实例下配置的资源列表。
 *
 * @param request ListInstanceResourcesRequest
 * @return ListInstanceResourcesResponse
 */
async function listInstanceResources(InstanceId: string, request: ListInstanceResourcesRequest): ListInstanceResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listInstanceResourcesWithOptions(InstanceId, request, headers, runtime);
}

model ListInstancesRequest {
  instanceId?: string(name='InstanceId', example='pairec-test1'),
  order?: string(name='Order', example='Desc'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='50'),
  sortBy?: string(name='SortBy', example='Type'),
  type?: string(name='Type', example='basic'),
}

model ListInstancesResponseBody = {
  instances?: [ 
    {
      chargeType?: string(name='ChargeType', example='Subscription'),
      commodityCode?: string(name='CommodityCode', example='airec_developers_public_cn'),
      config?: {
        dataManagements?: [ 
          {
            componentCode?: string(name='ComponentCode', example='storage'),
            meta?: map[string]any(name='Meta'),
            type?: string(name='Type', example='OSS'),
          }
        ](name='DataManagements'),
        engines?: [ 
          {
            componentCode?: string(name='ComponentCode', example='feature'),
            meta?: map[string]any(name='Meta'),
            type?: string(name='Type', example='Hologres'),
          }
        ](name='Engines'),
        monitors?: [ 
          {
            componentCode?: string(name='ComponentCode', example='featuresets'),
            meta?: map[string]any(name='Meta'),
            type?: string(name='Type', example='Platform'),
          }
        ](name='Monitors'),
      }(name='Config'),
      expiredTime?: string(name='ExpiredTime', example='2022-12-14 00:00:00.0'),
      gmtCreateTime?: string(name='GmtCreateTime', example='2022-10-13 17:34:52.0'),
      gmtModifiedTime?: string(name='GmtModifiedTime', example='2022-11-05 09:02:30.0'),
      instanceId?: string(name='InstanceId', example='pairec-test1'),
      operatingTool?: {
        isEnable?: boolean(name='IsEnable'),
      }(name='OperatingTool'),
      regionId?: string(name='RegionId', example='cn-shenzhen'),
      status?: string(name='Status', example='Initializing'),
      type?: string(name='Type', example='basic'),
    }
  ](name='Instances'),
  requestId?: string(name='RequestId', example='BDB621CB-A81E-5D39-8793-39A365CBCC74'),
  totalCount?: int32(name='TotalCount', example='7'),
}

model ListInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListInstancesResponseBody(name='body'),
}

/**
 * @summary 获取推荐全链路深度定制开发平台实例信息列表。
 *
 * @param request ListInstancesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListInstancesResponse
 */
async function listInstancesWithOptions(request: ListInstancesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListInstancesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListInstances',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取推荐全链路深度定制开发平台实例信息列表。
 *
 * @param request ListInstancesRequest
 * @return ListInstancesResponse
 */
async function listInstances(request: ListInstancesRequest): ListInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listInstancesWithOptions(request, headers, runtime);
}

model ListLaboratoriesRequest {
  environment?: string(name='Environment', example='Daily'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-test1'),
  sceneId?: string(name='SceneId', description='This parameter is required.', example='3'),
  status?: string(name='Status', example='Offline'),
}

model ListLaboratoriesResponseBody = {
  laboratories?: [ 
    {
      bucketCount?: int32(name='BucketCount', example='100'),
      bucketType?: string(name='BucketType', example='Filter'),
      buckets?: string(name='Buckets', example='1,2,3,10-20'),
      crowdId?: string(name='CrowdId', example='3'),
      debugCrowdId?: string(name='DebugCrowdId', example='3'),
      debugUsers?: string(name='DebugUsers', example='user1,user2,user3'),
      description?: string(name='Description', example='This is a test.'),
      environment?: string(name='Environment', example='Daily'),
      filter?: string(name='Filter', example='filter=xxx'),
      laboratoryId?: string(name='LaboratoryId', example='3'),
      name?: string(name='Name', example='laboratory1'),
      sceneId?: string(name='SceneId', example='3'),
      status?: string(name='Status', example='Offline'),
      type?: string(name='Type', example='Base'),
    }
  ](name='Laboratories'),
  requestId?: string(name='RequestId', description='Id of the request', example='1C0898E5-9220-5443-B2D9-445FF0688215'),
  totalCount?: long(name='TotalCount', example='10'),
}

model ListLaboratoriesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListLaboratoriesResponseBody(name='body'),
}

/**
 * @summary 获取实验室列表。
 *
 * @param request ListLaboratoriesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListLaboratoriesResponse
 */
async function listLaboratoriesWithOptions(request: ListLaboratoriesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListLaboratoriesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.environment)) {
    query['Environment'] = request.environment;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListLaboratories',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/laboratories`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取实验室列表。
 *
 * @param request ListLaboratoriesRequest
 * @return ListLaboratoriesResponse
 */
async function listLaboratories(request: ListLaboratoriesRequest): ListLaboratoriesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listLaboratoriesWithOptions(request, headers, runtime);
}

model ListLayersRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-abcdefg1234'),
  laboratoryId?: string(name='LaboratoryId', description='This parameter is required.', example='3'),
}

model ListLayersResponseBody = {
  layers?: [ 
    {
      description?: string(name='Description', example='This is a test.'),
      gmtCreateTime?: string(name='GmtCreateTime'),
      laboratoryId?: string(name='LaboratoryId', example='3'),
      layerId?: string(name='LayerId', example='3'),
      name?: string(name='Name', example='layer1'),
      residualFlow?: long(name='ResidualFlow'),
      sceneId?: string(name='SceneId', example='3'),
    }
  ](name='Layers'),
  requestId?: string(name='RequestId', description='Id of the request', example='518C64F6-DFF7-11ED-85B0-00163E14B3D1'),
  totalCount?: long(name='TotalCount', example='10'),
}

model ListLayersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListLayersResponseBody(name='body'),
}

/**
 * @summary 获取层列表。
 *
 * @param request ListLayersRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListLayersResponse
 */
async function listLayersWithOptions(request: ListLayersRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListLayersResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.laboratoryId)) {
    query['LaboratoryId'] = request.laboratoryId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListLayers',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/layers`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取层列表。
 *
 * @param request ListLayersRequest
 * @return ListLayersResponse
 */
async function listLayers(request: ListLayersRequest): ListLayersResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listLayersWithOptions(request, headers, runtime);
}

model ListParamsRequest {
  environment?: string(name='Environment', example='Daily'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-abcdefg1234'),
  name?: string(name='Name', example='home'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='50'),
  sceneId?: string(name='SceneId', description='This parameter is required.', example='3'),
}

model ListParamsResponseBody = {
  params?: [ 
    {
      environment?: string(name='Environment', example='Daily'),
      gmtModifiedTime?: string(name='GmtModifiedTime', example='2021-12-15T23:24:33.132+08:00'),
      name?: string(name='Name', example='home'),
      paramId?: string(name='ParamId', example='4'),
      value?: string(name='Value', example='house'),
    }
  ](name='Params'),
  requestId?: string(name='RequestId', description='Id of the request', example='A2D07551-38DA-531E-9B22-877D1D86A579'),
  totalCount?: long(name='TotalCount', example='10'),
}

model ListParamsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListParamsResponseBody(name='body'),
}

/**
 * @summary 获取参数列表。
 *
 * @param request ListParamsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListParamsResponse
 */
async function listParamsWithOptions(request: ListParamsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListParamsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.environment)) {
    query['Environment'] = request.environment;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListParams',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/params`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取参数列表。
 *
 * @param request ListParamsRequest
 * @return ListParamsResponse
 */
async function listParams(request: ListParamsRequest): ListParamsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listParamsWithOptions(request, headers, runtime);
}

model ListResourceRulesRequest {
  all?: boolean(name='All'),
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
  order?: string(name='Order'),
  pageNumber?: long(name='PageNumber'),
  pageSize?: long(name='PageSize'),
  resourceRuleId?: string(name='ResourceRuleId'),
  resourceRuleName?: string(name='ResourceRuleName'),
  sortBy?: string(name='SortBy'),
}

model ListResourceRulesResponseBody = {
  requestId?: string(name='RequestId'),
  resourceRules?: [ 
    {
      description?: string(name='Description'),
      metricOperationType?: string(name='MetricOperationType'),
      metricPullInfo?: string(name='MetricPullInfo'),
      metricPullPeriod?: string(name='MetricPullPeriod'),
      name?: string(name='Name'),
      resourceRuleId?: string(name='ResourceRuleId'),
      ruleComputingDefinition?: string(name='RuleComputingDefinition'),
      ruleItems?: [ 
        {
          description?: string(name='Description'),
          maxValue?: string(name='MaxValue'),
          minValue?: string(name='MinValue'),
          name?: string(name='Name'),
          value?: string(name='Value'),
        }
      ](name='RuleItems'),
    }
  ](name='ResourceRules'),
  totalCount?: long(name='TotalCount'),
}

model ListResourceRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListResourceRulesResponseBody(name='body'),
}

/**
 * @summary 获取资源规则列表
 *
 * @param request ListResourceRulesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListResourceRulesResponse
 */
async function listResourceRulesWithOptions(request: ListResourceRulesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListResourceRulesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.all)) {
    query['All'] = request.all;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceRuleId)) {
    query['ResourceRuleId'] = request.resourceRuleId;
  }
  if (!Util.isUnset(request.resourceRuleName)) {
    query['ResourceRuleName'] = request.resourceRuleName;
  }
  if (!Util.isUnset(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListResourceRules',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/resourcerules`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取资源规则列表
 *
 * @param request ListResourceRulesRequest
 * @return ListResourceRulesResponse
 */
async function listResourceRules(request: ListResourceRulesRequest): ListResourceRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listResourceRulesWithOptions(request, headers, runtime);
}

model ListScenesRequest {
  instanceId?: string(name='InstanceId', example='pairec-cn-abcdefg1234'),
  name?: string(name='Name', example='scene1'),
}

model ListScenesResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request', example='B8987BF7-6028-5B17-80E0-251B7BD67BBA'),
  scenes?: [ 
    {
      description?: string(name='Description', example='This is a test.'),
      flows?: [ 
        {
          flowCode?: string(name='FlowCode', example='liuliang1'),
          flowName?: string(name='FlowName', example='流量1'),
        }
      ](name='Flows'),
      name?: string(name='Name', example='scene1'),
      sceneId?: string(name='SceneId', example='3'),
    }
  ](name='Scenes'),
  totalCount?: long(name='TotalCount', example='10'),
}

model ListScenesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListScenesResponseBody(name='body'),
}

/**
 * @summary 获取场景列表
 *
 * @param request ListScenesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListScenesResponse
 */
async function listScenesWithOptions(request: ListScenesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListScenesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListScenes',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/scenes`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取场景列表
 *
 * @param request ListScenesRequest
 * @return ListScenesResponse
 */
async function listScenes(request: ListScenesRequest): ListScenesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listScenesWithOptions(request, headers, runtime);
}

model ListSubCrowdsRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-abcdefg1234'),
}

model ListSubCrowdsResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request', example='C5AEB79E-FAA4-5DCE-8CD7-1CAF549ECC3E'),
  subCrowds?: [ 
    {
      gmtCreateTime?: string(name='GmtCreateTime', example='2021-12-15T23:24:33.132+08:00'),
      quantity?: int32(name='Quantity', example='2'),
      source?: string(name='Source', example='ManualInput'),
      subCrowdId?: string(name='SubCrowdId', example='3'),
      users?: string(name='Users', example='user1,user2'),
    }
  ](name='SubCrowds'),
  totalCount?: long(name='TotalCount', example='10'),
}

model ListSubCrowdsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSubCrowdsResponseBody(name='body'),
}

/**
 * @summary 获取人群下的所有子人群。
 *
 * @param request ListSubCrowdsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSubCrowdsResponse
 */
async function listSubCrowdsWithOptions(CrowdId: string, request: ListSubCrowdsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListSubCrowdsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListSubCrowds',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/crowds/${OpenApiUtil.getEncodeParam(CrowdId)}/subcrowds`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取人群下的所有子人群。
 *
 * @param request ListSubCrowdsRequest
 * @return ListSubCrowdsResponse
 */
async function listSubCrowds(CrowdId: string, request: ListSubCrowdsRequest): ListSubCrowdsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listSubCrowdsWithOptions(CrowdId, request, headers, runtime);
}

model ListTableMetasRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-test1'),
  module?: string(name='Module', description='This parameter is required.', example='ABTest'),
  name?: string(name='Name', example='test1'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  type?: string(name='Type', example='MaxCompute'),
}

model ListTableMetasResponseBody = {
  requestId?: string(name='RequestId', example='728C5E01-ABF6-5AA8-B9FC-B3BA05DECC77'),
  tableMetas?: [ 
    {
      canDelete?: boolean(name='CanDelete', example='true'),
      config?: string(name='Config'),
      description?: string(name='Description', example='this is a test table'),
      fields?: [ 
        {
          isDimensionField?: boolean(name='IsDimensionField', example='false'),
          meaning?: string(name='Meaning', example='the gender of people'),
          name?: string(name='Name', example='gender'),
          type?: string(name='Type', example='BIGINT'),
        }
      ](name='Fields'),
      gmtCreateTime?: string(name='GmtCreateTime', example='2021-12-12 12:24:33'),
      gmtImportedTime?: string(name='GmtImportedTime', example='imprecation'),
      gmtModifiedTime?: string(name='GmtModifiedTime', example='2021-12-12 12:24:33'),
      module?: string(name='Module', example='ABTest'),
      name?: string(name='Name', example='test_table'),
      resourceId?: string(name='ResourceId', example='reso-2s416t***'),
      tableMetaId?: string(name='TableMetaId', example='3'),
      tableName?: string(name='TableName', example='table_mysql'),
      type?: string(name='Type', example='MaxCompute'),
      url?: string(name='Url', example='https://dmc-xxx.com/dm/table/xxx'),
    }
  ](name='TableMetas'),
  totalCount?: long(name='TotalCount', example='20'),
}

model ListTableMetasResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTableMetasResponseBody(name='body'),
}

/**
 * @summary 获取数据表列表。
 *
 * @param request ListTableMetasRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTableMetasResponse
 */
async function listTableMetasWithOptions(request: ListTableMetasRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListTableMetasResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.module)) {
    query['Module'] = request.module;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTableMetas',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/tablemetas`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取数据表列表。
 *
 * @param request ListTableMetasRequest
 * @return ListTableMetasResponse
 */
async function listTableMetas(request: ListTableMetasRequest): ListTableMetasResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listTableMetasWithOptions(request, headers, runtime);
}

model ListTrafficControlTargetTrafficHistoryRequest {
  endTime?: string(name='EndTime'),
  environment?: string(name='Environment'),
  experimentGroupId?: string(name='ExperimentGroupId'),
  experimentId?: string(name='ExperimentId'),
  instanceId?: string(name='InstanceId'),
  itemId?: string(name='ItemId'),
  startTime?: string(name='StartTime'),
  threshold?: string(name='Threshold'),
}

model ListTrafficControlTargetTrafficHistoryResponseBody = {
  requestId?: string(name='RequestId'),
  totalCount?: string(name='TotalCount'),
  trafficControlTaskTrafficHistories?: [ 
    {
      experimentId?: string(name='ExperimentId'),
      itemId?: string(name='ItemId'),
      recordTime?: string(name='RecordTime'),
      trafficControlTargetAimTraffic?: double(name='TrafficControlTargetAimTraffic'),
      trafficControlTargetTraffic?: double(name='TrafficControlTargetTraffic'),
      trafficControlTaskTraffic?: double(name='TrafficControlTaskTraffic'),
    }
  ](name='TrafficControlTaskTrafficHistories'),
}

model ListTrafficControlTargetTrafficHistoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTrafficControlTargetTrafficHistoryResponseBody(name='body'),
}

/**
 * @summary 获取流量调控任务流量变更的历史列表
 *
 * @param request ListTrafficControlTargetTrafficHistoryRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTrafficControlTargetTrafficHistoryResponse
 */
async function listTrafficControlTargetTrafficHistoryWithOptions(TrafficControlTargetId: string, request: ListTrafficControlTargetTrafficHistoryRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListTrafficControlTargetTrafficHistoryResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.environment)) {
    query['Environment'] = request.environment;
  }
  if (!Util.isUnset(request.experimentGroupId)) {
    query['ExperimentGroupId'] = request.experimentGroupId;
  }
  if (!Util.isUnset(request.experimentId)) {
    query['ExperimentId'] = request.experimentId;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.itemId)) {
    query['ItemId'] = request.itemId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.threshold)) {
    query['Threshold'] = request.threshold;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTrafficControlTargetTrafficHistory',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/trafficcontroltargets/${OpenApiUtil.getEncodeParam(TrafficControlTargetId)}/traffichistories`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取流量调控任务流量变更的历史列表
 *
 * @param request ListTrafficControlTargetTrafficHistoryRequest
 * @return ListTrafficControlTargetTrafficHistoryResponse
 */
async function listTrafficControlTargetTrafficHistory(TrafficControlTargetId: string, request: ListTrafficControlTargetTrafficHistoryRequest): ListTrafficControlTargetTrafficHistoryResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listTrafficControlTargetTrafficHistoryWithOptions(TrafficControlTargetId, request, headers, runtime);
}

model ListTrafficControlTasksRequest {
  all?: boolean(name='All'),
  controlTargetFilter?: string(name='ControlTargetFilter'),
  environment?: string(name='Environment'),
  instanceId?: string(name='InstanceId'),
  name?: string(name='Name'),
  order?: string(name='Order'),
  pageNumber?: string(name='PageNumber'),
  pageSize?: string(name='PageSize'),
  sceneId?: string(name='SceneId'),
  sortBy?: string(name='SortBy'),
  status?: string(name='Status'),
  trafficControlTaskId?: string(name='TrafficControlTaskId'),
  version?: string(name='Version'),
}

model ListTrafficControlTasksResponseBody = {
  requestId?: string(name='RequestId'),
  totalCount?: string(name='TotalCount'),
  trafficControlTasks?: [ 
    {
      behaviorTableMetaId?: string(name='BehaviorTableMetaId'),
      controlGranularity?: string(name='ControlGranularity'),
      controlLogic?: string(name='ControlLogic'),
      controlType?: string(name='ControlType'),
      description?: string(name='Description'),
      endTime?: string(name='EndTime'),
      everPublished?: boolean(name='EverPublished'),
      executionTime?: string(name='ExecutionTime'),
      gmtCreateTime?: string(name='GmtCreateTime'),
      gmtModifiedTime?: string(name='GmtModifiedTime'),
      itemConditionArray?: string(name='ItemConditionArray'),
      itemConditionExpress?: string(name='ItemConditionExpress'),
      itemConditionType?: string(name='ItemConditionType'),
      itemTableMetaId?: string(name='ItemTableMetaId'),
      name?: string(name='Name'),
      preExperimentIds?: string(name='PreExperimentIds'),
      prepubStatus?: string(name='PrepubStatus'),
      prodExperimentIds?: string(name='ProdExperimentIds'),
      productStatus?: string(name='ProductStatus'),
      sceneId?: string(name='SceneId'),
      sceneName?: string(name='SceneName'),
      serviceId?: string(name='ServiceId'),
      startTime?: string(name='StartTime'),
      statisBahaviorConditionExpress?: string(name='StatisBahaviorConditionExpress'),
      statisBehaviorConditionArray?: string(name='StatisBehaviorConditionArray'),
      statisBehaviorConditionType?: string(name='StatisBehaviorConditionType'),
      trafficControlTargets?: [ 
        {
          endTime?: string(name='EndTime'),
          event?: string(name='Event'),
          gmtCreateTime?: string(name='GmtCreateTime'),
          gmtModifiedTime?: string(name='GmtModifiedTime'),
          itemConditionArray?: string(name='ItemConditionArray'),
          itemConditionExpress?: string(name='ItemConditionExpress'),
          itemConditionType?: string(name='ItemConditionType'),
          name?: string(name='Name'),
          newProductRegulation?: boolean(name='NewProductRegulation'),
          recallName?: string(name='RecallName'),
          splitParts?: {
            setValues?: [ long ](name='SetValues'),
            timePoints?: [ long ](name='TimePoints'),
          }(name='SplitParts'),
          startTime?: string(name='StartTime'),
          statisPeriod?: string(name='StatisPeriod'),
          status?: string(name='Status'),
          toleranceValue?: long(name='ToleranceValue'),
          trafficControlTargetId?: string(name='TrafficControlTargetId'),
          value?: float(name='Value'),
        }
      ](name='TrafficControlTargets'),
      trafficControlTaskId?: string(name='TrafficControlTaskId'),
      userConditionArray?: string(name='UserConditionArray'),
      userConditionExpress?: string(name='UserConditionExpress'),
      userConditionType?: string(name='UserConditionType'),
      userTableMetaId?: string(name='UserTableMetaId'),
    }
  ](name='TrafficControlTasks'),
}

model ListTrafficControlTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTrafficControlTasksResponseBody(name='body'),
}

/**
 * @summary 获取流量调控列表
 *
 * @param request ListTrafficControlTasksRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTrafficControlTasksResponse
 */
async function listTrafficControlTasksWithOptions(request: ListTrafficControlTasksRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListTrafficControlTasksResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.all)) {
    query['All'] = request.all;
  }
  if (!Util.isUnset(request.controlTargetFilter)) {
    query['ControlTargetFilter'] = request.controlTargetFilter;
  }
  if (!Util.isUnset(request.environment)) {
    query['Environment'] = request.environment;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }
  if (!Util.isUnset(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.trafficControlTaskId)) {
    query['TrafficControlTaskId'] = request.trafficControlTaskId;
  }
  if (!Util.isUnset(request.version)) {
    query['Version'] = request.version;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTrafficControlTasks',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/trafficcontroltasks`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取流量调控列表
 *
 * @param request ListTrafficControlTasksRequest
 * @return ListTrafficControlTasksResponse
 */
async function listTrafficControlTasks(request: ListTrafficControlTasksRequest): ListTrafficControlTasksResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listTrafficControlTasksWithOptions(request, headers, runtime);
}

model OfflineExperimentRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-abcdefg1234'),
}

model OfflineExperimentResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request', example='872951C9-7755-5FA1-AACD-7F9375A6D27A'),
}

model OfflineExperimentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: OfflineExperimentResponseBody(name='body'),
}

/**
 * @summary 上线实验。
 *
 * @param request OfflineExperimentRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return OfflineExperimentResponse
 */
async function offlineExperimentWithOptions(ExperimentId: string, request: OfflineExperimentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): OfflineExperimentResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'OfflineExperiment',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/experiments/${OpenApiUtil.getEncodeParam(ExperimentId)}/action/offline`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 上线实验。
 *
 * @param request OfflineExperimentRequest
 * @return OfflineExperimentResponse
 */
async function offlineExperiment(ExperimentId: string, request: OfflineExperimentRequest): OfflineExperimentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return offlineExperimentWithOptions(ExperimentId, request, headers, runtime);
}

model OfflineExperimentGroupRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-abcdefg1234'),
}

model OfflineExperimentGroupResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request', example='518C64F6-DFF7-11ED-85B0-00163E14B3D1'),
}

model OfflineExperimentGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: OfflineExperimentGroupResponseBody(name='body'),
}

/**
 * @summary 下线实验组。
 *
 * @param request OfflineExperimentGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return OfflineExperimentGroupResponse
 */
async function offlineExperimentGroupWithOptions(ExperimentGroupId: string, request: OfflineExperimentGroupRequest, headers: map[string]string, runtime: Util.RuntimeOptions): OfflineExperimentGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'OfflineExperimentGroup',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/experimentgroups/${OpenApiUtil.getEncodeParam(ExperimentGroupId)}/action/offline`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 下线实验组。
 *
 * @param request OfflineExperimentGroupRequest
 * @return OfflineExperimentGroupResponse
 */
async function offlineExperimentGroup(ExperimentGroupId: string, request: OfflineExperimentGroupRequest): OfflineExperimentGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return offlineExperimentGroupWithOptions(ExperimentGroupId, request, headers, runtime);
}

model OfflineLaboratoryRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-abcdefg1234'),
}

model OfflineLaboratoryResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request', example='59CE7EC6-F268-5D71-9215-32922CC50D72'),
}

model OfflineLaboratoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: OfflineLaboratoryResponseBody(name='body'),
}

/**
 * @summary 下线实验室。
 *
 * @param request OfflineLaboratoryRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return OfflineLaboratoryResponse
 */
async function offlineLaboratoryWithOptions(LaboratoryId: string, request: OfflineLaboratoryRequest, headers: map[string]string, runtime: Util.RuntimeOptions): OfflineLaboratoryResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'OfflineLaboratory',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/laboratories/${OpenApiUtil.getEncodeParam(LaboratoryId)}/action/offline`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 下线实验室。
 *
 * @param request OfflineLaboratoryRequest
 * @return OfflineLaboratoryResponse
 */
async function offlineLaboratory(LaboratoryId: string, request: OfflineLaboratoryRequest): OfflineLaboratoryResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return offlineLaboratoryWithOptions(LaboratoryId, request, headers, runtime);
}

model OnlineExperimentRequest {
  instanceId?: string(name='InstanceId', example='pairec-cn-abcdefg1234'),
}

model OnlineExperimentResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request', example='6CF1E160-3F36-5E73-A170-C75504F05BBC'),
}

model OnlineExperimentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: OnlineExperimentResponseBody(name='body'),
}

/**
 * @summary 上线实验
 *
 * @param request OnlineExperimentRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return OnlineExperimentResponse
 */
async function onlineExperimentWithOptions(ExperimentId: string, request: OnlineExperimentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): OnlineExperimentResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'OnlineExperiment',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/experiments/${OpenApiUtil.getEncodeParam(ExperimentId)}/action/online`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 上线实验
 *
 * @param request OnlineExperimentRequest
 * @return OnlineExperimentResponse
 */
async function onlineExperiment(ExperimentId: string, request: OnlineExperimentRequest): OnlineExperimentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return onlineExperimentWithOptions(ExperimentId, request, headers, runtime);
}

model OnlineExperimentGroupRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-abcdefg1234'),
}

model OnlineExperimentGroupResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request', example='47F761ED-BE4E-51A6-B678-78E1490DF313'),
}

model OnlineExperimentGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: OnlineExperimentGroupResponseBody(name='body'),
}

/**
 * @summary 上线实验组。
 *
 * @param request OnlineExperimentGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return OnlineExperimentGroupResponse
 */
async function onlineExperimentGroupWithOptions(ExperimentGroupId: string, request: OnlineExperimentGroupRequest, headers: map[string]string, runtime: Util.RuntimeOptions): OnlineExperimentGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'OnlineExperimentGroup',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/experimentgroups/${OpenApiUtil.getEncodeParam(ExperimentGroupId)}/action/online`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 上线实验组。
 *
 * @param request OnlineExperimentGroupRequest
 * @return OnlineExperimentGroupResponse
 */
async function onlineExperimentGroup(ExperimentGroupId: string, request: OnlineExperimentGroupRequest): OnlineExperimentGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return onlineExperimentGroupWithOptions(ExperimentGroupId, request, headers, runtime);
}

model OnlineLaboratoryRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-test1'),
}

model OnlineLaboratoryResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request', example='8C27790E-CCA5-56BB-BA17-646295DEC0A2'),
}

model OnlineLaboratoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: OnlineLaboratoryResponseBody(name='body'),
}

/**
 * @summary 上线实验室。
 *
 * @param request OnlineLaboratoryRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return OnlineLaboratoryResponse
 */
async function onlineLaboratoryWithOptions(LaboratoryId: string, request: OnlineLaboratoryRequest, headers: map[string]string, runtime: Util.RuntimeOptions): OnlineLaboratoryResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'OnlineLaboratory',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/laboratories/${OpenApiUtil.getEncodeParam(LaboratoryId)}/action/online`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 上线实验室。
 *
 * @param request OnlineLaboratoryRequest
 * @return OnlineLaboratoryResponse
 */
async function onlineLaboratory(LaboratoryId: string, request: OnlineLaboratoryRequest): OnlineLaboratoryResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return onlineLaboratoryWithOptions(LaboratoryId, request, headers, runtime);
}

model PushAllExperimentRequest {
  instanceId?: string(name='InstanceId', example='pairec-cn-abcdefg1234'),
}

model PushAllExperimentResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request', example='74D958EF-3598-56FA-8296-FF1575CE43DF'),
}

model PushAllExperimentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PushAllExperimentResponseBody(name='body'),
}

/**
 * @summary 推全。
 *
 * @param request PushAllExperimentRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return PushAllExperimentResponse
 */
async function pushAllExperimentWithOptions(ExperimentId: string, request: PushAllExperimentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): PushAllExperimentResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'PushAllExperiment',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/experiments/${OpenApiUtil.getEncodeParam(ExperimentId)}/action/pushall`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 推全。
 *
 * @param request PushAllExperimentRequest
 * @return PushAllExperimentResponse
 */
async function pushAllExperiment(ExperimentId: string, request: PushAllExperimentRequest): PushAllExperimentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return pushAllExperimentWithOptions(ExperimentId, request, headers, runtime);
}

model PushResourceRuleRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
  metricInfo?: map[string]any(name='MetricInfo', description='This parameter is required.'),
}

model PushResourceRuleShrinkRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
  metricInfoShrink?: string(name='MetricInfo', description='This parameter is required.'),
}

model PushResourceRuleResponseBody = {
  description?: string(name='Description'),
  metricOperationType?: string(name='MetricOperationType'),
  metricPullInfo?: string(name='MetricPullInfo'),
  metricPullPeriod?: string(name='MetricPullPeriod'),
  name?: string(name='Name'),
  requestId?: string(name='RequestId'),
  resourceRuleId?: string(name='ResourceRuleId'),
  ruleComputingDefinition?: string(name='RuleComputingDefinition'),
  ruleItems?: [ 
    {
      description?: string(name='Description'),
      maxValue?: string(name='MaxValue'),
      minValue?: string(name='MinValue'),
      name?: string(name='Name'),
      value?: string(name='Value'),
    }
  ](name='RuleItems'),
}

model PushResourceRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PushResourceRuleResponseBody(name='body'),
}

/**
 * @summary 推送指标到指定资源规则
 *
 * @param tmpReq PushResourceRuleRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return PushResourceRuleResponse
 */
async function pushResourceRuleWithOptions(ResourceRuleId: string, tmpReq: PushResourceRuleRequest, headers: map[string]string, runtime: Util.RuntimeOptions): PushResourceRuleResponse {
  Util.validateModel(tmpReq);
  var request = new PushResourceRuleShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.metricInfo)) {
    request.metricInfoShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.metricInfo, 'MetricInfo', 'json');
  }
  var query : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.metricInfoShrink)) {
    query['MetricInfo'] = request.metricInfoShrink;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'PushResourceRule',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/resourcerules/${OpenApiUtil.getEncodeParam(ResourceRuleId)}/action/push`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 推送指标到指定资源规则
 *
 * @param request PushResourceRuleRequest
 * @return PushResourceRuleResponse
 */
async function pushResourceRule(ResourceRuleId: string, request: PushResourceRuleRequest): PushResourceRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return pushResourceRuleWithOptions(ResourceRuleId, request, headers, runtime);
}

model QueryTrafficControlTargetItemReportDetailRequest {
  date?: string(name='Date'),
  environment?: string(name='Environment', description='This parameter is required.'),
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
}

model QueryTrafficControlTargetItemReportDetailResponseBody = {
  requestId?: string(name='RequestId'),
  trafficControlTargetItemReportDetail?: {
    itemControlTailReportDetails?: [ 
      {
        features?: map[string]any(name='Features'),
        itemId?: string(name='ItemId'),
        targetProgress?: string(name='TargetProgress'),
        targetTraffic?: long(name='TargetTraffic'),
      }
    ](name='ItemControlTailReportDetails'),
    itemControlTopReportDetails?: [ 
      {
        features?: map[string]any(name='Features'),
        itemId?: string(name='ItemId'),
        targetProgress?: string(name='TargetProgress'),
        targetTraffic?: long(name='TargetTraffic'),
      }
    ](name='ItemControlTopReportDetails'),
  }(name='TrafficControlTargetItemReportDetail'),
}

model QueryTrafficControlTargetItemReportDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryTrafficControlTargetItemReportDetailResponseBody(name='body'),
}

/**
 * @summary 查询流量调控目标的单品调控报表详情。
 *
 * @param request QueryTrafficControlTargetItemReportDetailRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryTrafficControlTargetItemReportDetailResponse
 */
async function queryTrafficControlTargetItemReportDetailWithOptions(TrafficControlTargetId: string, request: QueryTrafficControlTargetItemReportDetailRequest, headers: map[string]string, runtime: Util.RuntimeOptions): QueryTrafficControlTargetItemReportDetailResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.date)) {
    query['Date'] = request.date;
  }
  if (!Util.isUnset(request.environment)) {
    query['Environment'] = request.environment;
  }
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryTrafficControlTargetItemReportDetail',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/trafficcontroltargets/${OpenApiUtil.getEncodeParam(TrafficControlTargetId)}/itemcontrolreportdetail`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询流量调控目标的单品调控报表详情。
 *
 * @param request QueryTrafficControlTargetItemReportDetailRequest
 * @return QueryTrafficControlTargetItemReportDetailResponse
 */
async function queryTrafficControlTargetItemReportDetail(TrafficControlTargetId: string, request: QueryTrafficControlTargetItemReportDetailRequest): QueryTrafficControlTargetItemReportDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return queryTrafficControlTargetItemReportDetailWithOptions(TrafficControlTargetId, request, headers, runtime);
}

model ReleaseTrafficControlTaskRequest {
  environment?: string(name='Environment'),
  instanceId?: string(name='InstanceId'),
}

model ReleaseTrafficControlTaskResponseBody = {
  requestId?: string(name='RequestId'),
}

model ReleaseTrafficControlTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ReleaseTrafficControlTaskResponseBody(name='body'),
}

/**
 * @summary 发布流量调控任务
 *
 * @param request ReleaseTrafficControlTaskRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ReleaseTrafficControlTaskResponse
 */
async function releaseTrafficControlTaskWithOptions(TrafficControlTaskId: string, request: ReleaseTrafficControlTaskRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ReleaseTrafficControlTaskResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.environment)) {
    body['Environment'] = request.environment;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ReleaseTrafficControlTask',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/trafficcontroltasks/${OpenApiUtil.getEncodeParam(TrafficControlTaskId)}/action/release`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 发布流量调控任务
 *
 * @param request ReleaseTrafficControlTaskRequest
 * @return ReleaseTrafficControlTaskResponse
 */
async function releaseTrafficControlTask(TrafficControlTaskId: string, request: ReleaseTrafficControlTaskRequest): ReleaseTrafficControlTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return releaseTrafficControlTaskWithOptions(TrafficControlTaskId, request, headers, runtime);
}

model ReportABMetricGroupRequest {
  baseExperimentId?: string(name='BaseExperimentId', description='This parameter is required.', example='3'),
  dimensionFields?: string(name='DimensionFields', example='{"gender":"man"}'),
  endDate?: string(name='EndDate', example='2021-07-01'),
  experimentGroupId?: string(name='ExperimentGroupId', example='3'),
  experimentIds?: string(name='ExperimentIds', description='This parameter is required.', example='3,4,5'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-test1'),
  reportType?: string(name='ReportType', description='This parameter is required.', example='Offline'),
  sceneId?: string(name='SceneId', example='1'),
  startDate?: string(name='StartDate', example='2021-07-01'),
  timeStatisticsMethod?: string(name='TimeStatisticsMethod', example='Hour'),
}

model ReportABMetricGroupResponseBody = {
  experimentReport?: map[string]ExperimentReportValue(name='ExperimentReport'),
  groupDimension?: [ string ](name='GroupDimension'),
  requestId?: string(name='RequestId', example='59CE7EC6-F268-5D71-9215-32922CC50D72'),
}

model ReportABMetricGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ReportABMetricGroupResponseBody(name='body'),
}

/**
 * @summary 对指标组进行报表。
 *
 * @param request ReportABMetricGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ReportABMetricGroupResponse
 */
async function reportABMetricGroupWithOptions(ABMetricGroupId: string, request: ReportABMetricGroupRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ReportABMetricGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.baseExperimentId)) {
    body['BaseExperimentId'] = request.baseExperimentId;
  }
  if (!Util.isUnset(request.dimensionFields)) {
    body['DimensionFields'] = request.dimensionFields;
  }
  if (!Util.isUnset(request.endDate)) {
    body['EndDate'] = request.endDate;
  }
  if (!Util.isUnset(request.experimentGroupId)) {
    body['ExperimentGroupId'] = request.experimentGroupId;
  }
  if (!Util.isUnset(request.experimentIds)) {
    body['ExperimentIds'] = request.experimentIds;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.reportType)) {
    body['ReportType'] = request.reportType;
  }
  if (!Util.isUnset(request.sceneId)) {
    body['SceneId'] = request.sceneId;
  }
  if (!Util.isUnset(request.startDate)) {
    body['StartDate'] = request.startDate;
  }
  if (!Util.isUnset(request.timeStatisticsMethod)) {
    body['TimeStatisticsMethod'] = request.timeStatisticsMethod;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ReportABMetricGroup',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/abmetricgroups/${OpenApiUtil.getEncodeParam(ABMetricGroupId)}/action/report`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 对指标组进行报表。
 *
 * @param request ReportABMetricGroupRequest
 * @return ReportABMetricGroupResponse
 */
async function reportABMetricGroup(ABMetricGroupId: string, request: ReportABMetricGroupRequest): ReportABMetricGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return reportABMetricGroupWithOptions(ABMetricGroupId, request, headers, runtime);
}

model SplitTrafficControlTargetRequest {
  environment?: string(name='Environment'),
  instanceId?: string(name='InstanceId'),
  setPoints?: [ long ](name='SetPoints'),
  setValues?: [ long ](name='SetValues'),
  timePoints?: [ long ](name='TimePoints'),
}

model SplitTrafficControlTargetResponseBody = {
  requestId?: string(name='RequestId'),
}

model SplitTrafficControlTargetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SplitTrafficControlTargetResponseBody(name='body'),
}

/**
 * @summary 拆分流量调控目标
 *
 * @param request SplitTrafficControlTargetRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return SplitTrafficControlTargetResponse
 */
async function splitTrafficControlTargetWithOptions(TrafficControlTargetId: string, request: SplitTrafficControlTargetRequest, headers: map[string]string, runtime: Util.RuntimeOptions): SplitTrafficControlTargetResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.environment)) {
    body['Environment'] = request.environment;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.setPoints)) {
    body['SetPoints'] = request.setPoints;
  }
  if (!Util.isUnset(request.setValues)) {
    body['SetValues'] = request.setValues;
  }
  if (!Util.isUnset(request.timePoints)) {
    body['TimePoints'] = request.timePoints;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SplitTrafficControlTarget',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/trafficcontroltargets/${OpenApiUtil.getEncodeParam(TrafficControlTargetId)}/action/split`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 拆分流量调控目标
 *
 * @param request SplitTrafficControlTargetRequest
 * @return SplitTrafficControlTargetResponse
 */
async function splitTrafficControlTarget(TrafficControlTargetId: string, request: SplitTrafficControlTargetRequest): SplitTrafficControlTargetResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return splitTrafficControlTargetWithOptions(TrafficControlTargetId, request, headers, runtime);
}

model StartTrafficControlTargetRequest {
  instanceId?: string(name='InstanceId'),
}

model StartTrafficControlTargetResponseBody = {
  requestId?: string(name='RequestId'),
}

model StartTrafficControlTargetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartTrafficControlTargetResponseBody(name='body'),
}

/**
 * @summary 开启流量调控目标
 *
 * @param request StartTrafficControlTargetRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartTrafficControlTargetResponse
 */
async function startTrafficControlTargetWithOptions(TrafficControlTargetId: string, request: StartTrafficControlTargetRequest, headers: map[string]string, runtime: Util.RuntimeOptions): StartTrafficControlTargetResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'StartTrafficControlTarget',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/trafficcontroltargets/${OpenApiUtil.getEncodeParam(TrafficControlTargetId)}/action/start`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 开启流量调控目标
 *
 * @param request StartTrafficControlTargetRequest
 * @return StartTrafficControlTargetResponse
 */
async function startTrafficControlTarget(TrafficControlTargetId: string, request: StartTrafficControlTargetRequest): StartTrafficControlTargetResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return startTrafficControlTargetWithOptions(TrafficControlTargetId, request, headers, runtime);
}

model StartTrafficControlTaskRequest {
  environment?: string(name='Environment'),
  instanceId?: string(name='InstanceId'),
}

model StartTrafficControlTaskResponseBody = {
  requestId?: string(name='RequestId'),
}

model StartTrafficControlTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartTrafficControlTaskResponseBody(name='body'),
}

/**
 * @summary 开启流量调控任务
 *
 * @param request StartTrafficControlTaskRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartTrafficControlTaskResponse
 */
async function startTrafficControlTaskWithOptions(TrafficControlTaskId: string, request: StartTrafficControlTaskRequest, headers: map[string]string, runtime: Util.RuntimeOptions): StartTrafficControlTaskResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.environment)) {
    body['Environment'] = request.environment;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'StartTrafficControlTask',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/trafficcontroltasks/${OpenApiUtil.getEncodeParam(TrafficControlTaskId)}/action/start`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 开启流量调控任务
 *
 * @param request StartTrafficControlTaskRequest
 * @return StartTrafficControlTaskResponse
 */
async function startTrafficControlTask(TrafficControlTaskId: string, request: StartTrafficControlTaskRequest): StartTrafficControlTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return startTrafficControlTaskWithOptions(TrafficControlTaskId, request, headers, runtime);
}

model StopTrafficControlTargetRequest {
  instanceId?: string(name='InstanceId'),
}

model StopTrafficControlTargetResponseBody = {
  requestId?: string(name='RequestId'),
}

model StopTrafficControlTargetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopTrafficControlTargetResponseBody(name='body'),
}

/**
 * @summary 停止流量调控目标
 *
 * @param request StopTrafficControlTargetRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return StopTrafficControlTargetResponse
 */
async function stopTrafficControlTargetWithOptions(TrafficControlTargetId: string, request: StopTrafficControlTargetRequest, headers: map[string]string, runtime: Util.RuntimeOptions): StopTrafficControlTargetResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'StopTrafficControlTarget',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/trafficcontroltargets/${OpenApiUtil.getEncodeParam(TrafficControlTargetId)}/action/stop`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 停止流量调控目标
 *
 * @param request StopTrafficControlTargetRequest
 * @return StopTrafficControlTargetResponse
 */
async function stopTrafficControlTarget(TrafficControlTargetId: string, request: StopTrafficControlTargetRequest): StopTrafficControlTargetResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return stopTrafficControlTargetWithOptions(TrafficControlTargetId, request, headers, runtime);
}

model StopTrafficControlTaskRequest {
  regionId?: string(name='RegionId'),
  environment?: string(name='Environment'),
  instanceId?: string(name='InstanceId'),
}

model StopTrafficControlTaskResponseBody = {
  requestId?: string(name='RequestId'),
}

model StopTrafficControlTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopTrafficControlTaskResponseBody(name='body'),
}

/**
 * @summary 停止流量调控任务
 *
 * @param request StopTrafficControlTaskRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return StopTrafficControlTaskResponse
 */
async function stopTrafficControlTaskWithOptions(TrafficControlTaskId: string, request: StopTrafficControlTaskRequest, headers: map[string]string, runtime: Util.RuntimeOptions): StopTrafficControlTaskResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.environment)) {
    body['Environment'] = request.environment;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'StopTrafficControlTask',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/trafficcontroltasks/${OpenApiUtil.getEncodeParam(TrafficControlTaskId)}/action/stop`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 停止流量调控任务
 *
 * @param request StopTrafficControlTaskRequest
 * @return StopTrafficControlTaskResponse
 */
async function stopTrafficControlTask(TrafficControlTaskId: string, request: StopTrafficControlTaskRequest): StopTrafficControlTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return stopTrafficControlTaskWithOptions(TrafficControlTaskId, request, headers, runtime);
}

model SyncFeatureConsistencyCheckJobReplayLogRequest {
  contextFeatures?: string(name='ContextFeatures', description='This parameter is required.', example='[{\\\\"Value\\\\":{\\\\"FloatFeature\\\\":0.1}}]'),
  featureConsistencyCheckJobConfigId?: string(name='FeatureConsistencyCheckJobConfigId', description='This parameter is required.', example='3'),
  generatedFeatures?: string(name='GeneratedFeatures', description='This parameter is required.', example='week_day:1 | userid:3 | itemid:9001 | cate:cat1 | click_5_seq__cate:cat1'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-********'),
  logItemId?: string(name='LogItemId', description='This parameter is required.', example='9010'),
  logRequestId?: string(name='LogRequestId', description='This parameter is required.', example='728C5E01-ABF6-5AA8-B9FC-B3BA05DECC77'),
  logRequestTime?: long(name='LogRequestTime', description='This parameter is required.', example='1693900981465'),
  logUserId?: string(name='LogUserId', description='This parameter is required.', example='1010'),
  rawFeatures?: string(name='RawFeatures', description='This parameter is required.'),
  sceneName?: string(name='SceneName', description='This parameter is required.', example='video-feed'),
}

model SyncFeatureConsistencyCheckJobReplayLogResponseBody = {
  requestId?: string(name='RequestId', example='C7D0B48F-0105-52B9-B60A-FA7606E2234D'),
}

model SyncFeatureConsistencyCheckJobReplayLogResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SyncFeatureConsistencyCheckJobReplayLogResponseBody(name='body'),
}

/**
 * @summary 同步特征一致性检测任务重放日志。
 *
 * @param request SyncFeatureConsistencyCheckJobReplayLogRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return SyncFeatureConsistencyCheckJobReplayLogResponse
 */
async function syncFeatureConsistencyCheckJobReplayLogWithOptions(request: SyncFeatureConsistencyCheckJobReplayLogRequest, headers: map[string]string, runtime: Util.RuntimeOptions): SyncFeatureConsistencyCheckJobReplayLogResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.contextFeatures)) {
    body['ContextFeatures'] = request.contextFeatures;
  }
  if (!Util.isUnset(request.featureConsistencyCheckJobConfigId)) {
    body['FeatureConsistencyCheckJobConfigId'] = request.featureConsistencyCheckJobConfigId;
  }
  if (!Util.isUnset(request.generatedFeatures)) {
    body['GeneratedFeatures'] = request.generatedFeatures;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.logItemId)) {
    body['LogItemId'] = request.logItemId;
  }
  if (!Util.isUnset(request.logRequestId)) {
    body['LogRequestId'] = request.logRequestId;
  }
  if (!Util.isUnset(request.logRequestTime)) {
    body['LogRequestTime'] = request.logRequestTime;
  }
  if (!Util.isUnset(request.logUserId)) {
    body['LogUserId'] = request.logUserId;
  }
  if (!Util.isUnset(request.rawFeatures)) {
    body['RawFeatures'] = request.rawFeatures;
  }
  if (!Util.isUnset(request.sceneName)) {
    body['SceneName'] = request.sceneName;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SyncFeatureConsistencyCheckJobReplayLog',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/featureconsistencycheck/jobs/action/syncreplaylog`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 同步特征一致性检测任务重放日志。
 *
 * @param request SyncFeatureConsistencyCheckJobReplayLogRequest
 * @return SyncFeatureConsistencyCheckJobReplayLogResponse
 */
async function syncFeatureConsistencyCheckJobReplayLog(request: SyncFeatureConsistencyCheckJobReplayLogRequest): SyncFeatureConsistencyCheckJobReplayLogResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return syncFeatureConsistencyCheckJobReplayLogWithOptions(request, headers, runtime);
}

model TerminateFeatureConsistencyCheckJobRequest {
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-********'),
}

model TerminateFeatureConsistencyCheckJobResponseBody = {
  requestId?: string(name='RequestId', example='A6C01890-54CA-5C49-BC91-AD85A98E4A98'),
}

model TerminateFeatureConsistencyCheckJobResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TerminateFeatureConsistencyCheckJobResponseBody(name='body'),
}

/**
 * @summary 取消指定特征一致性检查正在运行中的任务。
 *
 * @param request TerminateFeatureConsistencyCheckJobRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return TerminateFeatureConsistencyCheckJobResponse
 */
async function terminateFeatureConsistencyCheckJobWithOptions(FeatureConsistencyCheckJobId: string, request: TerminateFeatureConsistencyCheckJobRequest, headers: map[string]string, runtime: Util.RuntimeOptions): TerminateFeatureConsistencyCheckJobResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'TerminateFeatureConsistencyCheckJob',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/featureconsistencycheck/jobs/${OpenApiUtil.getEncodeParam(FeatureConsistencyCheckJobId)}/action/terminate`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 取消指定特征一致性检查正在运行中的任务。
 *
 * @param request TerminateFeatureConsistencyCheckJobRequest
 * @return TerminateFeatureConsistencyCheckJobResponse
 */
async function terminateFeatureConsistencyCheckJob(FeatureConsistencyCheckJobId: string, request: TerminateFeatureConsistencyCheckJobRequest): TerminateFeatureConsistencyCheckJobResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return terminateFeatureConsistencyCheckJobWithOptions(FeatureConsistencyCheckJobId, request, headers, runtime);
}

model UpdateABMetricRequest {
  definition?: string(name='Definition', description='This parameter is required.', example='sum(click_cnt)'),
  description?: string(name='Description', description='This parameter is required.'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-test123'),
  leftMetricId?: string(name='LeftMetricId', example='2'),
  name?: string(name='Name', description='This parameter is required.', example='pv'),
  operator?: string(name='Operator', example='Division'),
  realtime?: boolean(name='Realtime', description='This parameter is required.', example='false'),
  resultResourceId?: string(name='ResultResourceId', example='3'),
  rightMetricId?: string(name='RightMetricId', example='3'),
  sceneId?: string(name='SceneId', description='This parameter is required.', example='1'),
  statisticsCycle?: int32(name='StatisticsCycle', example='1'),
  tableMetaId?: string(name='TableMetaId', description='This parameter is required.', example='2'),
  type?: string(name='Type', description='This parameter is required.', example='Single'),
}

model UpdateABMetricResponseBody = {
  requestId?: string(name='RequestId', example='6CF1E160-3F36-5E73-A170-C75504F05BBC'),
}

model UpdateABMetricResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateABMetricResponseBody(name='body'),
}

/**
 * @summary 更新AB Test实验指标。
 *
 * @param request UpdateABMetricRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateABMetricResponse
 */
async function updateABMetricWithOptions(ABMetricId: string, request: UpdateABMetricRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateABMetricResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.definition)) {
    body['Definition'] = request.definition;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.leftMetricId)) {
    body['LeftMetricId'] = request.leftMetricId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.operator)) {
    body['Operator'] = request.operator;
  }
  if (!Util.isUnset(request.realtime)) {
    body['Realtime'] = request.realtime;
  }
  if (!Util.isUnset(request.resultResourceId)) {
    body['ResultResourceId'] = request.resultResourceId;
  }
  if (!Util.isUnset(request.rightMetricId)) {
    body['RightMetricId'] = request.rightMetricId;
  }
  if (!Util.isUnset(request.sceneId)) {
    body['SceneId'] = request.sceneId;
  }
  if (!Util.isUnset(request.statisticsCycle)) {
    body['StatisticsCycle'] = request.statisticsCycle;
  }
  if (!Util.isUnset(request.tableMetaId)) {
    body['TableMetaId'] = request.tableMetaId;
  }
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateABMetric',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/abmetrics/${OpenApiUtil.getEncodeParam(ABMetricId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新AB Test实验指标。
 *
 * @param request UpdateABMetricRequest
 * @return UpdateABMetricResponse
 */
async function updateABMetric(ABMetricId: string, request: UpdateABMetricRequest): UpdateABMetricResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateABMetricWithOptions(ABMetricId, request, headers, runtime);
}

model UpdateABMetricGroupRequest {
  ABMetricIds?: string(name='ABMetricIds', description='This parameter is required.', example='1,2'),
  description?: string(name='Description', description='This parameter is required.'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-test1'),
  name?: string(name='Name', description='This parameter is required.', example='visits'),
  realtime?: boolean(name='Realtime', description='This parameter is required.', example='false'),
  sceneId?: string(name='SceneId', description='This parameter is required.', example='1'),
}

model UpdateABMetricGroupResponseBody = {
  requestId?: string(name='RequestId', example='74D958EF-3598-56FA-8296-FF1575CE43DF'),
}

model UpdateABMetricGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateABMetricGroupResponseBody(name='body'),
}

/**
 * @summary 更新AB test实验指标组。
 *
 * @param request UpdateABMetricGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateABMetricGroupResponse
 */
async function updateABMetricGroupWithOptions(ABMetricGroupId: string, request: UpdateABMetricGroupRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateABMetricGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.ABMetricIds)) {
    body['ABMetricIds'] = request.ABMetricIds;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.realtime)) {
    body['Realtime'] = request.realtime;
  }
  if (!Util.isUnset(request.sceneId)) {
    body['SceneId'] = request.sceneId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateABMetricGroup',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/abmetricgroups/${OpenApiUtil.getEncodeParam(ABMetricGroupId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新AB test实验指标组。
 *
 * @param request UpdateABMetricGroupRequest
 * @return UpdateABMetricGroupResponse
 */
async function updateABMetricGroup(ABMetricGroupId: string, request: UpdateABMetricGroupRequest): UpdateABMetricGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateABMetricGroupWithOptions(ABMetricGroupId, request, headers, runtime);
}

model UpdateCrowdRequest {
  description?: string(name='Description', description='This parameter is required.', example='This is a test.'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-test1'),
  name?: string(name='Name', description='This parameter is required.', example='xx人群'),
}

model UpdateCrowdResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request', example='8C27790E-CCA5-56BB-BA17-646295DEC0A2'),
}

model UpdateCrowdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateCrowdResponseBody(name='body'),
}

/**
 * @summary 更新指定人群。
 *
 * @param request UpdateCrowdRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateCrowdResponse
 */
async function updateCrowdWithOptions(CrowdId: string, request: UpdateCrowdRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateCrowdResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateCrowd',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/crowds/${OpenApiUtil.getEncodeParam(CrowdId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新指定人群。
 *
 * @param request UpdateCrowdRequest
 * @return UpdateCrowdResponse
 */
async function updateCrowd(CrowdId: string, request: UpdateCrowdRequest): UpdateCrowdResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateCrowdWithOptions(CrowdId, request, headers, runtime);
}

model UpdateEngineConfigRequest {
  configValue?: string(name='ConfigValue', example='{
	"ListenConf": {
		"HttpAddr": "",
		"HttpPort": 8000
	}
}'),
  description?: string(name='Description'),
  environment?: string(name='Environment', example='Pre'),
  instanceId?: string(name='InstanceId', example='pairec-cn-***test'),
  name?: string(name='Name', example='engine_config_v1'),
}

model UpdateEngineConfigResponseBody = {
  requestId?: string(name='RequestId', example='F8F613A9-DF1C-551A-88E1-397A3981A785'),
}

model UpdateEngineConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateEngineConfigResponseBody(name='body'),
}

/**
 * @summary 更新引擎配置。
 *
 * @param request UpdateEngineConfigRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateEngineConfigResponse
 */
async function updateEngineConfigWithOptions(EngineConfigId: string, request: UpdateEngineConfigRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateEngineConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.configValue)) {
    body['ConfigValue'] = request.configValue;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.environment)) {
    body['Environment'] = request.environment;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateEngineConfig',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/engineconfigs/${OpenApiUtil.getEncodeParam(EngineConfigId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新引擎配置。
 *
 * @param request UpdateEngineConfigRequest
 * @return UpdateEngineConfigResponse
 */
async function updateEngineConfig(EngineConfigId: string, request: UpdateEngineConfigRequest): UpdateEngineConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateEngineConfigWithOptions(EngineConfigId, request, headers, runtime);
}

model UpdateExperimentRequest {
  config?: string(name='Config', example='{"RankBy": "Score"}'),
  debugCrowdId?: string(name='DebugCrowdId', example='3'),
  debugUsers?: string(name='DebugUsers', example='1124512470******,1124512471******,1124512472******'),
  description?: string(name='Description', description='This parameter is required.', example='This is a test.'),
  flowPercent?: int32(name='FlowPercent', example='100'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-abcdefg1234'),
  name?: string(name='Name', description='This parameter is required.', example='experiment_test'),
  type?: string(name='Type', description='This parameter is required.', example='Baseline'),
}

model UpdateExperimentResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request', example='A760D972-1475-58C0-BBB3-92B5FB08904F'),
}

model UpdateExperimentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateExperimentResponseBody(name='body'),
}

/**
 * @summary 更新实验。
 *
 * @param request UpdateExperimentRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateExperimentResponse
 */
async function updateExperimentWithOptions(ExperimentId: string, request: UpdateExperimentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateExperimentResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.config)) {
    body['Config'] = request.config;
  }
  if (!Util.isUnset(request.debugCrowdId)) {
    body['DebugCrowdId'] = request.debugCrowdId;
  }
  if (!Util.isUnset(request.debugUsers)) {
    body['DebugUsers'] = request.debugUsers;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.flowPercent)) {
    body['FlowPercent'] = request.flowPercent;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateExperiment',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/experiments/${OpenApiUtil.getEncodeParam(ExperimentId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新实验。
 *
 * @param request UpdateExperimentRequest
 * @return UpdateExperimentResponse
 */
async function updateExperiment(ExperimentId: string, request: UpdateExperimentRequest): UpdateExperimentResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateExperimentWithOptions(ExperimentId, request, headers, runtime);
}

model UpdateExperimentGroupRequest {
  config?: string(name='Config', example='{"RankBy": "Score"}'),
  crowdId?: string(name='CrowdId', example='3'),
  crowdTargetType?: string(name='CrowdTargetType'),
  debugCrowdId?: string(name='DebugCrowdId', example='3'),
  debugUsers?: string(name='DebugUsers', example='user1,user2,user3'),
  description?: string(name='Description', description='This parameter is required.', example='This is a test.'),
  distributionTimeDuration?: int32(name='DistributionTimeDuration', example='3'),
  distributionType?: string(name='DistributionType', example='UserId'),
  filter?: string(name='Filter', example='gender=male'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-abcdefg1234'),
  layerId?: string(name='LayerId', description='This parameter is required.', example='3'),
  name?: string(name='Name', description='This parameter is required.', example='experiment_group1'),
  needAA?: boolean(name='NeedAA', example='true'),
  randomFlow?: long(name='RandomFlow'),
  reservcedBuckets?: string(name='ReservcedBuckets', example='1,2,3'),
}

model UpdateExperimentGroupResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request', example='F7AC05FF-EDE7-5C2B-B9AE-33D6DF4178BA'),
}

model UpdateExperimentGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateExperimentGroupResponseBody(name='body'),
}

/**
 * @summary 更新指定实验组。
 *
 * @param request UpdateExperimentGroupRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateExperimentGroupResponse
 */
async function updateExperimentGroupWithOptions(ExperimentGroupId: string, request: UpdateExperimentGroupRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateExperimentGroupResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.config)) {
    body['Config'] = request.config;
  }
  if (!Util.isUnset(request.crowdId)) {
    body['CrowdId'] = request.crowdId;
  }
  if (!Util.isUnset(request.crowdTargetType)) {
    body['CrowdTargetType'] = request.crowdTargetType;
  }
  if (!Util.isUnset(request.debugCrowdId)) {
    body['DebugCrowdId'] = request.debugCrowdId;
  }
  if (!Util.isUnset(request.debugUsers)) {
    body['DebugUsers'] = request.debugUsers;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.distributionTimeDuration)) {
    body['DistributionTimeDuration'] = request.distributionTimeDuration;
  }
  if (!Util.isUnset(request.distributionType)) {
    body['DistributionType'] = request.distributionType;
  }
  if (!Util.isUnset(request.filter)) {
    body['Filter'] = request.filter;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.layerId)) {
    body['LayerId'] = request.layerId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.needAA)) {
    body['NeedAA'] = request.needAA;
  }
  if (!Util.isUnset(request.randomFlow)) {
    body['RandomFlow'] = request.randomFlow;
  }
  if (!Util.isUnset(request.reservcedBuckets)) {
    body['ReservcedBuckets'] = request.reservcedBuckets;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateExperimentGroup',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/experimentgroups/${OpenApiUtil.getEncodeParam(ExperimentGroupId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新指定实验组。
 *
 * @param request UpdateExperimentGroupRequest
 * @return UpdateExperimentGroupResponse
 */
async function updateExperimentGroup(ExperimentGroupId: string, request: UpdateExperimentGroupRequest): UpdateExperimentGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateExperimentGroupWithOptions(ExperimentGroupId, request, headers, runtime);
}

model UpdateFeatureConsistencyCheckJobConfigRequest {
  compareFeature?: boolean(name='CompareFeature', description='This parameter is required.', example='true'),
  datasetId?: string(name='DatasetId'),
  datasetMountPath?: string(name='DatasetMountPath'),
  datasetName?: string(name='DatasetName'),
  datasetType?: string(name='DatasetType'),
  datasetUri?: string(name='DatasetUri'),
  defaultRoute?: string(name='DefaultRoute'),
  easServiceName?: string(name='EasServiceName', description='This parameter is required.', example='service_123'),
  easyRecPackagePath?: string(name='EasyRecPackagePath', example='oss://********'),
  easyRecVersion?: string(name='EasyRecVersion', example='1.3.60'),
  featureDisplayExclude?: string(name='FeatureDisplayExclude', example='feature1,feature2'),
  featureLandingResourceId?: string(name='FeatureLandingResourceId', description='This parameter is required.', example='reso-********'),
  featurePriority?: string(name='FeaturePriority', example='feature1,feature2,feature3'),
  featureStoreItemId?: string(name='FeatureStoreItemId'),
  featureStoreModelId?: string(name='FeatureStoreModelId'),
  featureStoreProjectId?: string(name='FeatureStoreProjectId'),
  featureStoreProjectName?: string(name='FeatureStoreProjectName'),
  featureStoreSeqFeatureView?: string(name='FeatureStoreSeqFeatureView'),
  featureStoreUserId?: string(name='FeatureStoreUserId'),
  fgJarVersion?: string(name='FgJarVersion', example='1.0.0'),
  fgJsonFileName?: string(name='FgJsonFileName', description='This parameter is required.', example='file.json'),
  generateZip?: boolean(name='GenerateZip', description='This parameter is required.', example='true'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-********'),
  isUseFeatureStore?: boolean(name='IsUseFeatureStore'),
  itemIdField?: string(name='ItemIdField', description='This parameter is required.', example='item_id'),
  itemTable?: string(name='ItemTable', description='This parameter is required.', example='item_table'),
  itemTablePartitionField?: string(name='ItemTablePartitionField', description='This parameter is required.', example='ds'),
  itemTablePartitionFieldFormat?: string(name='ItemTablePartitionFieldFormat', description='This parameter is required.', example='yyyymmdd'),
  name?: string(name='Name', description='This parameter is required.', example='feature_consistency_check1'),
  ossResourceId?: string(name='OssResourceId', example='reso-********'),
  predictWorkerCount?: int32(name='PredictWorkerCount'),
  predictWorkerCpu?: int32(name='PredictWorkerCpu'),
  predictWorkerMemory?: int32(name='PredictWorkerMemory'),
  sampleRate?: double(name='SampleRate', description='This parameter is required.', example='0.89'),
  sceneId?: string(name='SceneId', description='This parameter is required.', example='3'),
  securityGroupId?: string(name='SecurityGroupId'),
  serviceId?: string(name='ServiceId', example='4'),
  switchId?: string(name='SwitchId'),
  userIdField?: string(name='UserIdField', description='This parameter is required.', example='user_id'),
  userTable?: string(name='UserTable', description='This parameter is required.', example='user_table'),
  userTablePartitionField?: string(name='UserTablePartitionField', description='This parameter is required.', example='ds'),
  userTablePartitionFieldFormat?: string(name='UserTablePartitionFieldFormat', description='This parameter is required.', example='yyyymmdd'),
  vpcId?: string(name='VpcId'),
  workflowName?: string(name='WorkflowName', example='work_flow_1'),
  workspaceId?: string(name='WorkspaceId'),
}

model UpdateFeatureConsistencyCheckJobConfigResponseBody = {
  requestId?: string(name='RequestId', example='A04CB8C0-E74A-5E83-BC61-64D153574EC7'),
}

model UpdateFeatureConsistencyCheckJobConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateFeatureConsistencyCheckJobConfigResponseBody(name='body'),
}

/**
 * @summary 更新特征一致性检查配置信息。
 *
 * @param request UpdateFeatureConsistencyCheckJobConfigRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateFeatureConsistencyCheckJobConfigResponse
 */
async function updateFeatureConsistencyCheckJobConfigWithOptions(FeatureConsistencyCheckJobConfigId: string, request: UpdateFeatureConsistencyCheckJobConfigRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateFeatureConsistencyCheckJobConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.compareFeature)) {
    body['CompareFeature'] = request.compareFeature;
  }
  if (!Util.isUnset(request.datasetId)) {
    body['DatasetId'] = request.datasetId;
  }
  if (!Util.isUnset(request.datasetMountPath)) {
    body['DatasetMountPath'] = request.datasetMountPath;
  }
  if (!Util.isUnset(request.datasetName)) {
    body['DatasetName'] = request.datasetName;
  }
  if (!Util.isUnset(request.datasetType)) {
    body['DatasetType'] = request.datasetType;
  }
  if (!Util.isUnset(request.datasetUri)) {
    body['DatasetUri'] = request.datasetUri;
  }
  if (!Util.isUnset(request.defaultRoute)) {
    body['DefaultRoute'] = request.defaultRoute;
  }
  if (!Util.isUnset(request.easServiceName)) {
    body['EasServiceName'] = request.easServiceName;
  }
  if (!Util.isUnset(request.easyRecPackagePath)) {
    body['EasyRecPackagePath'] = request.easyRecPackagePath;
  }
  if (!Util.isUnset(request.easyRecVersion)) {
    body['EasyRecVersion'] = request.easyRecVersion;
  }
  if (!Util.isUnset(request.featureDisplayExclude)) {
    body['FeatureDisplayExclude'] = request.featureDisplayExclude;
  }
  if (!Util.isUnset(request.featureLandingResourceId)) {
    body['FeatureLandingResourceId'] = request.featureLandingResourceId;
  }
  if (!Util.isUnset(request.featurePriority)) {
    body['FeaturePriority'] = request.featurePriority;
  }
  if (!Util.isUnset(request.featureStoreItemId)) {
    body['FeatureStoreItemId'] = request.featureStoreItemId;
  }
  if (!Util.isUnset(request.featureStoreModelId)) {
    body['FeatureStoreModelId'] = request.featureStoreModelId;
  }
  if (!Util.isUnset(request.featureStoreProjectId)) {
    body['FeatureStoreProjectId'] = request.featureStoreProjectId;
  }
  if (!Util.isUnset(request.featureStoreProjectName)) {
    body['FeatureStoreProjectName'] = request.featureStoreProjectName;
  }
  if (!Util.isUnset(request.featureStoreSeqFeatureView)) {
    body['FeatureStoreSeqFeatureView'] = request.featureStoreSeqFeatureView;
  }
  if (!Util.isUnset(request.featureStoreUserId)) {
    body['FeatureStoreUserId'] = request.featureStoreUserId;
  }
  if (!Util.isUnset(request.fgJarVersion)) {
    body['FgJarVersion'] = request.fgJarVersion;
  }
  if (!Util.isUnset(request.fgJsonFileName)) {
    body['FgJsonFileName'] = request.fgJsonFileName;
  }
  if (!Util.isUnset(request.generateZip)) {
    body['GenerateZip'] = request.generateZip;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.isUseFeatureStore)) {
    body['IsUseFeatureStore'] = request.isUseFeatureStore;
  }
  if (!Util.isUnset(request.itemIdField)) {
    body['ItemIdField'] = request.itemIdField;
  }
  if (!Util.isUnset(request.itemTable)) {
    body['ItemTable'] = request.itemTable;
  }
  if (!Util.isUnset(request.itemTablePartitionField)) {
    body['ItemTablePartitionField'] = request.itemTablePartitionField;
  }
  if (!Util.isUnset(request.itemTablePartitionFieldFormat)) {
    body['ItemTablePartitionFieldFormat'] = request.itemTablePartitionFieldFormat;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.ossResourceId)) {
    body['OssResourceId'] = request.ossResourceId;
  }
  if (!Util.isUnset(request.predictWorkerCount)) {
    body['PredictWorkerCount'] = request.predictWorkerCount;
  }
  if (!Util.isUnset(request.predictWorkerCpu)) {
    body['PredictWorkerCpu'] = request.predictWorkerCpu;
  }
  if (!Util.isUnset(request.predictWorkerMemory)) {
    body['PredictWorkerMemory'] = request.predictWorkerMemory;
  }
  if (!Util.isUnset(request.sampleRate)) {
    body['SampleRate'] = request.sampleRate;
  }
  if (!Util.isUnset(request.sceneId)) {
    body['SceneId'] = request.sceneId;
  }
  if (!Util.isUnset(request.securityGroupId)) {
    body['SecurityGroupId'] = request.securityGroupId;
  }
  if (!Util.isUnset(request.serviceId)) {
    body['ServiceId'] = request.serviceId;
  }
  if (!Util.isUnset(request.switchId)) {
    body['SwitchId'] = request.switchId;
  }
  if (!Util.isUnset(request.userIdField)) {
    body['UserIdField'] = request.userIdField;
  }
  if (!Util.isUnset(request.userTable)) {
    body['UserTable'] = request.userTable;
  }
  if (!Util.isUnset(request.userTablePartitionField)) {
    body['UserTablePartitionField'] = request.userTablePartitionField;
  }
  if (!Util.isUnset(request.userTablePartitionFieldFormat)) {
    body['UserTablePartitionFieldFormat'] = request.userTablePartitionFieldFormat;
  }
  if (!Util.isUnset(request.vpcId)) {
    body['VpcId'] = request.vpcId;
  }
  if (!Util.isUnset(request.workflowName)) {
    body['WorkflowName'] = request.workflowName;
  }
  if (!Util.isUnset(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateFeatureConsistencyCheckJobConfig',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/featureconsistencycheck/jobconfigs/${OpenApiUtil.getEncodeParam(FeatureConsistencyCheckJobConfigId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新特征一致性检查配置信息。
 *
 * @param request UpdateFeatureConsistencyCheckJobConfigRequest
 * @return UpdateFeatureConsistencyCheckJobConfigResponse
 */
async function updateFeatureConsistencyCheckJobConfig(FeatureConsistencyCheckJobConfigId: string, request: UpdateFeatureConsistencyCheckJobConfigRequest): UpdateFeatureConsistencyCheckJobConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateFeatureConsistencyCheckJobConfigWithOptions(FeatureConsistencyCheckJobConfigId, request, headers, runtime);
}

model UpdateInstanceResourceRequest {
  config?: string(name='Config', example='{}'),
  uri?: string(name='Uri', example='bucket-test-123'),
}

model UpdateInstanceResourceResponseBody = {
  requestId?: string(name='RequestId', example='3AAA45F6-0798-5461-9360-81D133823CE7'),
}

model UpdateInstanceResourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateInstanceResourceResponseBody(name='body'),
}

/**
 * @summary 更新指定实例下指定资源的信息。
 *
 * @param request UpdateInstanceResourceRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateInstanceResourceResponse
 */
async function updateInstanceResourceWithOptions(InstanceId: string, ResourceId: string, request: UpdateInstanceResourceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateInstanceResourceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.config)) {
    body['Config'] = request.config;
  }
  if (!Util.isUnset(request.uri)) {
    body['Uri'] = request.uri;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateInstanceResource',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/resources/${OpenApiUtil.getEncodeParam(ResourceId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新指定实例下指定资源的信息。
 *
 * @param request UpdateInstanceResourceRequest
 * @return UpdateInstanceResourceResponse
 */
async function updateInstanceResource(InstanceId: string, ResourceId: string, request: UpdateInstanceResourceRequest): UpdateInstanceResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateInstanceResourceWithOptions(InstanceId, ResourceId, request, headers, runtime);
}

model UpdateLaboratoryRequest {
  bucketCount?: int32(name='BucketCount', example='24'),
  bucketType?: string(name='BucketType', description='This parameter is required.', example='Filter'),
  buckets?: string(name='Buckets', example='1,2,3,10-20'),
  debugCrowdId?: string(name='DebugCrowdId', example='3'),
  debugUsers?: string(name='DebugUsers', example='1124512470******,1124512471******,1124512472******'),
  description?: string(name='Description', example='This is a test.'),
  environment?: string(name='Environment', example='Daily'),
  filter?: string(name='Filter', example='filter=xxx'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-test1'),
  name?: string(name='Name', description='This parameter is required.', example='laboratory1'),
  type?: string(name='Type', description='This parameter is required.', example='Base'),
}

model UpdateLaboratoryResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request', example='A04CB8C0-E74A-5E83-BC61-64D153574EC7'),
}

model UpdateLaboratoryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateLaboratoryResponseBody(name='body'),
}

/**
 * @summary 更新实验室。
 *
 * @param request UpdateLaboratoryRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateLaboratoryResponse
 */
async function updateLaboratoryWithOptions(LaboratoryId: string, request: UpdateLaboratoryRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateLaboratoryResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.bucketCount)) {
    body['BucketCount'] = request.bucketCount;
  }
  if (!Util.isUnset(request.bucketType)) {
    body['BucketType'] = request.bucketType;
  }
  if (!Util.isUnset(request.buckets)) {
    body['Buckets'] = request.buckets;
  }
  if (!Util.isUnset(request.debugCrowdId)) {
    body['DebugCrowdId'] = request.debugCrowdId;
  }
  if (!Util.isUnset(request.debugUsers)) {
    body['DebugUsers'] = request.debugUsers;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.environment)) {
    body['Environment'] = request.environment;
  }
  if (!Util.isUnset(request.filter)) {
    body['Filter'] = request.filter;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateLaboratory',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/laboratories/${OpenApiUtil.getEncodeParam(LaboratoryId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新实验室。
 *
 * @param request UpdateLaboratoryRequest
 * @return UpdateLaboratoryResponse
 */
async function updateLaboratory(LaboratoryId: string, request: UpdateLaboratoryRequest): UpdateLaboratoryResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateLaboratoryWithOptions(LaboratoryId, request, headers, runtime);
}

model UpdateLayerRequest {
  description?: string(name='Description', description='This parameter is required.', example='This is a test.'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-test1'),
  name?: string(name='Name', description='This parameter is required.', example='layer1'),
}

model UpdateLayerResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request', example='0EA9215E-EC21-53AB-B8D9-D3DEA90D040A'),
}

model UpdateLayerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateLayerResponseBody(name='body'),
}

/**
 * @summary 更新层。
 *
 * @param request UpdateLayerRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateLayerResponse
 */
async function updateLayerWithOptions(LayerId: string, request: UpdateLayerRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateLayerResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateLayer',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/layers/${OpenApiUtil.getEncodeParam(LayerId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新层。
 *
 * @param request UpdateLayerRequest
 * @return UpdateLayerResponse
 */
async function updateLayer(LayerId: string, request: UpdateLayerRequest): UpdateLayerResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateLayerWithOptions(LayerId, request, headers, runtime);
}

model UpdateParamRequest {
  instanceId?: string(name='InstanceId', example='pairec-cn-abcdefg1234'),
  value?: string(name='Value', example='house'),
}

model UpdateParamResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request', example='BBD41FBF-E75C-551A-92FA-CAD654AA006F'),
}

model UpdateParamResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateParamResponseBody(name='body'),
}

/**
 * @summary 更新参数。
 *
 * @param request UpdateParamRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateParamResponse
 */
async function updateParamWithOptions(ParamId: string, request: UpdateParamRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateParamResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.value)) {
    body['Value'] = request.value;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateParam',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/params/${OpenApiUtil.getEncodeParam(ParamId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新参数。
 *
 * @param request UpdateParamRequest
 * @return UpdateParamResponse
 */
async function updateParam(ParamId: string, request: UpdateParamRequest): UpdateParamResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateParamWithOptions(ParamId, request, headers, runtime);
}

model UpdateResourceRuleRequest {
  description?: string(name='Description'),
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
  metricOperationType?: string(name='MetricOperationType', description='This parameter is required.'),
  metricPullInfo?: string(name='MetricPullInfo'),
  metricPullPeriod?: string(name='MetricPullPeriod'),
  name?: string(name='Name', description='This parameter is required.'),
  ruleComputingDefinition?: string(name='RuleComputingDefinition', description='This parameter is required.'),
}

model UpdateResourceRuleResponseBody = {
  requestId?: string(name='RequestId'),
}

model UpdateResourceRuleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateResourceRuleResponseBody(name='body'),
}

/**
 * @summary 获取资源规则列表
 *
 * @param request UpdateResourceRuleRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateResourceRuleResponse
 */
async function updateResourceRuleWithOptions(ResourceRuleId: string, request: UpdateResourceRuleRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateResourceRuleResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.metricOperationType)) {
    body['MetricOperationType'] = request.metricOperationType;
  }
  if (!Util.isUnset(request.metricPullInfo)) {
    body['MetricPullInfo'] = request.metricPullInfo;
  }
  if (!Util.isUnset(request.metricPullPeriod)) {
    body['MetricPullPeriod'] = request.metricPullPeriod;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.ruleComputingDefinition)) {
    body['RuleComputingDefinition'] = request.ruleComputingDefinition;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateResourceRule',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/resourcerules/${OpenApiUtil.getEncodeParam(ResourceRuleId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取资源规则列表
 *
 * @param request UpdateResourceRuleRequest
 * @return UpdateResourceRuleResponse
 */
async function updateResourceRule(ResourceRuleId: string, request: UpdateResourceRuleRequest): UpdateResourceRuleResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateResourceRuleWithOptions(ResourceRuleId, request, headers, runtime);
}

model UpdateResourceRuleItemRequest {
  description?: string(name='Description'),
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
  maxValue?: double(name='MaxValue'),
  minValue?: double(name='MinValue'),
  name?: string(name='Name', description='This parameter is required.'),
  value?: double(name='Value'),
}

model UpdateResourceRuleItemResponseBody = {
  requestId?: string(name='RequestId'),
}

model UpdateResourceRuleItemResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateResourceRuleItemResponseBody(name='body'),
}

/**
 * @summary 更新资源规则条目
 *
 * @param request UpdateResourceRuleItemRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateResourceRuleItemResponse
 */
async function updateResourceRuleItemWithOptions(ResourceRuleId: string, ResourceRuleItemId: string, request: UpdateResourceRuleItemRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateResourceRuleItemResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.maxValue)) {
    body['MaxValue'] = request.maxValue;
  }
  if (!Util.isUnset(request.minValue)) {
    body['MinValue'] = request.minValue;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.value)) {
    body['Value'] = request.value;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateResourceRuleItem',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/resourcerules/${OpenApiUtil.getEncodeParam(ResourceRuleId)}/items/${OpenApiUtil.getEncodeParam(ResourceRuleItemId)}`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新资源规则条目
 *
 * @param request UpdateResourceRuleItemRequest
 * @return UpdateResourceRuleItemResponse
 */
async function updateResourceRuleItem(ResourceRuleId: string, ResourceRuleItemId: string, request: UpdateResourceRuleItemRequest): UpdateResourceRuleItemResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateResourceRuleItemWithOptions(ResourceRuleId, ResourceRuleItemId, request, headers, runtime);
}

model UpdateSceneRequest {
  description?: string(name='Description', example='This is a test.'),
  flows?: [ 
    {
      flowCode?: string(name='FlowCode', example='liuliang1'),
      flowName?: string(name='FlowName', example='流量1'),
    }
  ](name='Flows'),
  instanceId?: string(name='InstanceId', example='pairec-cn-abcdefg1234'),
  name?: string(name='Name', example='scene1'),
}

model UpdateSceneResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request', example='FC17887E-3C82-5096-8AA6-F4C2E7417245'),
}

model UpdateSceneResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateSceneResponseBody(name='body'),
}

/**
 * @summary 更新场景
 *
 * @param request UpdateSceneRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateSceneResponse
 */
async function updateSceneWithOptions(SceneId: string, request: UpdateSceneRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateSceneResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.flows)) {
    body['Flows'] = request.flows;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateScene',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/scenes/${OpenApiUtil.getEncodeParam(SceneId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新场景
 *
 * @param request UpdateSceneRequest
 * @return UpdateSceneResponse
 */
async function updateScene(SceneId: string, request: UpdateSceneRequest): UpdateSceneResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateSceneWithOptions(SceneId, request, headers, runtime);
}

model UpdateTableMetaRequest {
  description?: string(name='Description', example='this is a test table'),
  fields?: [ 
    {
      dataType?: string(name='DataType'),
      isDimensionField?: boolean(name='IsDimensionField', description='This parameter is required.', example='false'),
      isPartitionField?: string(name='IsPartitionField', description='This parameter is required.'),
      meaning?: string(name='Meaning', description='This parameter is required.'),
      name?: string(name='Name', description='This parameter is required.', example='name'),
      type?: string(name='Type', description='This parameter is required.', example='BIGINT'),
    }
  ](name='Fields', description='This parameter is required.'),
  instanceId?: string(name='InstanceId', description='This parameter is required.', example='pairec-cn-test1'),
  module?: string(name='Module', description='This parameter is required.', example='ABTest'),
  name?: string(name='Name', description='This parameter is required.', example='table_test'),
  resourceId?: string(name='ResourceId', description='This parameter is required.', example='reso-2s416t***'),
  tableName?: string(name='TableName', description='This parameter is required.', example='table_mysql'),
}

model UpdateTableMetaResponseBody = {
  requestId?: string(name='RequestId', example='728C5E01-ABF6-5AA8-B9FC-B3BA05DECC77'),
}

model UpdateTableMetaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateTableMetaResponseBody(name='body'),
}

/**
 * @summary 获取数据表详细信息。
 *
 * @param request UpdateTableMetaRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateTableMetaResponse
 */
async function updateTableMetaWithOptions(TableMetaId: string, request: UpdateTableMetaRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateTableMetaResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.fields)) {
    body['Fields'] = request.fields;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.module)) {
    body['Module'] = request.module;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.resourceId)) {
    body['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.tableName)) {
    body['TableName'] = request.tableName;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateTableMeta',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/tablemetas/${OpenApiUtil.getEncodeParam(TableMetaId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取数据表详细信息。
 *
 * @param request UpdateTableMetaRequest
 * @return UpdateTableMetaResponse
 */
async function updateTableMeta(TableMetaId: string, request: UpdateTableMetaRequest): UpdateTableMetaResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateTableMetaWithOptions(TableMetaId, request, headers, runtime);
}

model UpdateTrafficControlTargetRequest {
  endTime?: string(name='EndTime'),
  event?: string(name='Event'),
  itemConditionArray?: string(name='ItemConditionArray'),
  itemConditionExpress?: string(name='ItemConditionExpress'),
  itemConditionType?: string(name='ItemConditionType'),
  name?: string(name='Name'),
  newProductRegulation?: boolean(name='NewProductRegulation'),
  recallName?: string(name='RecallName'),
  startTime?: string(name='StartTime'),
  statisPeriod?: string(name='StatisPeriod'),
  status?: string(name='Status'),
  toleranceValue?: long(name='ToleranceValue'),
  value?: float(name='Value'),
  newParam3?: string(name='new-param-3'),
}

model UpdateTrafficControlTargetResponseBody = {
  requestId?: string(name='RequestId'),
}

model UpdateTrafficControlTargetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateTrafficControlTargetResponseBody(name='body'),
}

/**
 * @summary 更新流量调控目标
 *
 * @param request UpdateTrafficControlTargetRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateTrafficControlTargetResponse
 */
async function updateTrafficControlTargetWithOptions(TrafficControlTargetId: string, request: UpdateTrafficControlTargetRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateTrafficControlTargetResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.newParam3)) {
    query['new-param-3'] = request.newParam3;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.event)) {
    body['Event'] = request.event;
  }
  if (!Util.isUnset(request.itemConditionArray)) {
    body['ItemConditionArray'] = request.itemConditionArray;
  }
  if (!Util.isUnset(request.itemConditionExpress)) {
    body['ItemConditionExpress'] = request.itemConditionExpress;
  }
  if (!Util.isUnset(request.itemConditionType)) {
    body['ItemConditionType'] = request.itemConditionType;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.newProductRegulation)) {
    body['NewProductRegulation'] = request.newProductRegulation;
  }
  if (!Util.isUnset(request.recallName)) {
    body['RecallName'] = request.recallName;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.statisPeriod)) {
    body['StatisPeriod'] = request.statisPeriod;
  }
  if (!Util.isUnset(request.status)) {
    body['Status'] = request.status;
  }
  if (!Util.isUnset(request.toleranceValue)) {
    body['ToleranceValue'] = request.toleranceValue;
  }
  if (!Util.isUnset(request.value)) {
    body['Value'] = request.value;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateTrafficControlTarget',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/trafficcontroltargets/${OpenApiUtil.getEncodeParam(TrafficControlTargetId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新流量调控目标
 *
 * @param request UpdateTrafficControlTargetRequest
 * @return UpdateTrafficControlTargetResponse
 */
async function updateTrafficControlTarget(TrafficControlTargetId: string, request: UpdateTrafficControlTargetRequest): UpdateTrafficControlTargetResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateTrafficControlTargetWithOptions(TrafficControlTargetId, request, headers, runtime);
}

model UpdateTrafficControlTaskRequest {
  behaviorTableMetaId?: string(name='BehaviorTableMetaId'),
  controlGranularity?: string(name='ControlGranularity'),
  controlLogic?: string(name='ControlLogic'),
  controlType?: string(name='ControlType'),
  description?: string(name='Description'),
  endTime?: string(name='EndTime'),
  executionTime?: string(name='ExecutionTime'),
  instanceId?: string(name='InstanceId'),
  itemConditionArray?: string(name='ItemConditionArray'),
  itemConditionExpress?: string(name='ItemConditionExpress'),
  itemConditionType?: string(name='ItemConditionType'),
  itemTableMetaId?: string(name='ItemTableMetaId'),
  name?: string(name='Name'),
  preExperimentIds?: string(name='PreExperimentIds'),
  prodExperimentIds?: string(name='ProdExperimentIds'),
  sceneId?: string(name='SceneId'),
  serviceId?: string(name='ServiceId'),
  startTime?: string(name='StartTime'),
  statisBaeaviorConditionArray?: string(name='StatisBaeaviorConditionArray'),
  statisBehaviorConditionExpress?: string(name='StatisBehaviorConditionExpress'),
  statisBehaviorConditionType?: string(name='StatisBehaviorConditionType'),
  trafficControlTargets?: [ 
    {
      endTime?: string(name='EndTime'),
      event?: string(name='Event'),
      itemConditionArray?: string(name='ItemConditionArray'),
      itemConditionExpress?: string(name='ItemConditionExpress'),
      itemConditionType?: string(name='ItemConditionType'),
      name?: string(name='Name'),
      newProductRegulation?: boolean(name='NewProductRegulation'),
      recallName?: string(name='RecallName'),
      startTime?: string(name='StartTime'),
      statisPeriod?: string(name='StatisPeriod'),
      status?: string(name='Status'),
      toleranceValue?: long(name='ToleranceValue'),
      value?: float(name='Value'),
    }
  ](name='TrafficControlTargets'),
  userConditionArray?: string(name='UserConditionArray'),
  userConditionExpress?: string(name='UserConditionExpress'),
  userConditionType?: string(name='UserConditionType'),
  userTableMetaId?: string(name='UserTableMetaId'),
}

model UpdateTrafficControlTaskResponseBody = {
  requestId?: string(name='RequestId'),
}

model UpdateTrafficControlTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateTrafficControlTaskResponseBody(name='body'),
}

/**
 * @summary 更新流量调控任务
 *
 * @param request UpdateTrafficControlTaskRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateTrafficControlTaskResponse
 */
async function updateTrafficControlTaskWithOptions(TrafficControlTaskId: string, request: UpdateTrafficControlTaskRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateTrafficControlTaskResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.behaviorTableMetaId)) {
    body['BehaviorTableMetaId'] = request.behaviorTableMetaId;
  }
  if (!Util.isUnset(request.controlGranularity)) {
    body['ControlGranularity'] = request.controlGranularity;
  }
  if (!Util.isUnset(request.controlLogic)) {
    body['ControlLogic'] = request.controlLogic;
  }
  if (!Util.isUnset(request.controlType)) {
    body['ControlType'] = request.controlType;
  }
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.executionTime)) {
    body['ExecutionTime'] = request.executionTime;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.itemConditionArray)) {
    body['ItemConditionArray'] = request.itemConditionArray;
  }
  if (!Util.isUnset(request.itemConditionExpress)) {
    body['ItemConditionExpress'] = request.itemConditionExpress;
  }
  if (!Util.isUnset(request.itemConditionType)) {
    body['ItemConditionType'] = request.itemConditionType;
  }
  if (!Util.isUnset(request.itemTableMetaId)) {
    body['ItemTableMetaId'] = request.itemTableMetaId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.preExperimentIds)) {
    body['PreExperimentIds'] = request.preExperimentIds;
  }
  if (!Util.isUnset(request.prodExperimentIds)) {
    body['ProdExperimentIds'] = request.prodExperimentIds;
  }
  if (!Util.isUnset(request.sceneId)) {
    body['SceneId'] = request.sceneId;
  }
  if (!Util.isUnset(request.serviceId)) {
    body['ServiceId'] = request.serviceId;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.statisBaeaviorConditionArray)) {
    body['StatisBaeaviorConditionArray'] = request.statisBaeaviorConditionArray;
  }
  if (!Util.isUnset(request.statisBehaviorConditionExpress)) {
    body['StatisBehaviorConditionExpress'] = request.statisBehaviorConditionExpress;
  }
  if (!Util.isUnset(request.statisBehaviorConditionType)) {
    body['StatisBehaviorConditionType'] = request.statisBehaviorConditionType;
  }
  if (!Util.isUnset(request.trafficControlTargets)) {
    body['TrafficControlTargets'] = request.trafficControlTargets;
  }
  if (!Util.isUnset(request.userConditionArray)) {
    body['UserConditionArray'] = request.userConditionArray;
  }
  if (!Util.isUnset(request.userConditionExpress)) {
    body['UserConditionExpress'] = request.userConditionExpress;
  }
  if (!Util.isUnset(request.userConditionType)) {
    body['UserConditionType'] = request.userConditionType;
  }
  if (!Util.isUnset(request.userTableMetaId)) {
    body['UserTableMetaId'] = request.userTableMetaId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateTrafficControlTask',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/trafficcontroltasks/${OpenApiUtil.getEncodeParam(TrafficControlTaskId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新流量调控任务
 *
 * @param request UpdateTrafficControlTaskRequest
 * @return UpdateTrafficControlTaskResponse
 */
async function updateTrafficControlTask(TrafficControlTaskId: string, request: UpdateTrafficControlTaskRequest): UpdateTrafficControlTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateTrafficControlTaskWithOptions(TrafficControlTaskId, request, headers, runtime);
}

model UpdateTrafficControlTaskTrafficRequest {
  environment?: string(name='Environment'),
  instanceId?: string(name='InstanceId'),
  traffics?: [ 
    {
      itemOrExperimentId?: string(name='ItemOrExperimentId'),
      recordTime?: string(name='RecordTime'),
      trafficControlTargetAimTraffic?: double(name='TrafficControlTargetAimTraffic'),
      trafficControlTargetId?: string(name='TrafficControlTargetId'),
      trafficControlTargetTraffic?: long(name='TrafficControlTargetTraffic'),
      trafficControlTaskTraffic?: long(name='TrafficControlTaskTraffic'),
    }
  ](name='Traffics'),
  newParam3?: string(name='new-param-3'),
}

model UpdateTrafficControlTaskTrafficResponseBody = {
  requestId?: string(name='RequestId'),
}

model UpdateTrafficControlTaskTrafficResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateTrafficControlTaskTrafficResponseBody(name='body'),
}

/**
 * @summary 更新流量调控任务的流量参数
 *
 * @param request UpdateTrafficControlTaskTrafficRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateTrafficControlTaskTrafficResponse
 */
async function updateTrafficControlTaskTrafficWithOptions(TrafficControlTaskId: string, request: UpdateTrafficControlTaskTrafficRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateTrafficControlTaskTrafficResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.newParam3)) {
    query['new-param-3'] = request.newParam3;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.environment)) {
    body['Environment'] = request.environment;
  }
  if (!Util.isUnset(request.instanceId)) {
    body['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.traffics)) {
    body['Traffics'] = request.traffics;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateTrafficControlTaskTraffic',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/trafficcontroltasks/${OpenApiUtil.getEncodeParam(TrafficControlTaskId)}/action/traffic`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新流量调控任务的流量参数
 *
 * @param request UpdateTrafficControlTaskTrafficRequest
 * @return UpdateTrafficControlTaskTrafficResponse
 */
async function updateTrafficControlTaskTraffic(TrafficControlTaskId: string, request: UpdateTrafficControlTaskTrafficRequest): UpdateTrafficControlTaskTrafficResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateTrafficControlTaskTrafficWithOptions(TrafficControlTaskId, request, headers, runtime);
}

model UploadRecommendationDataRequest {
  regionId?: string(name='RegionId'),
  content?: [ 
    {
      fields?: string(name='Fields'),
      operationType?: string(name='OperationType'),
    }
  ](name='Content'),
  dataType?: string(name='DataType'),
}

model UploadRecommendationDataResponseBody = {
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model UploadRecommendationDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UploadRecommendationDataResponseBody(name='body'),
}

/**
 * @summary 上传数据
 *
 * @param request UploadRecommendationDataRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UploadRecommendationDataResponse
 */
async function uploadRecommendationDataWithOptions(request: UploadRecommendationDataRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UploadRecommendationDataResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }

  var body : map[string]any = {};
  if (!Util.isUnset(request.content)) {
    body['Content'] = request.content;
  }
  if (!Util.isUnset(request.dataType)) {
    body['DataType'] = request.dataType;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UploadRecommendationData',
    version = '2022-12-13',
    protocol = 'HTTPS',
    pathname = `/api/v1/recommendationdata/action/upload`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 上传数据
 *
 * @param request UploadRecommendationDataRequest
 * @return UploadRecommendationDataResponse
 */
async function uploadRecommendationData(request: UploadRecommendationDataRequest): UploadRecommendationDataResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return uploadRecommendationDataWithOptions(request, headers, runtime);
}

